Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the signature of input list #9977

Merged
merged 1 commit into from Aug 10, 2023

Conversation

amtoine
Copy link
Member

@amtoine amtoine commented Aug 10, 2023

Description

in its documentation, input list says it only accepts the following signatures

  • list<any> -> list<any>
  • list<string> -> string

however this is incorrect as the following is allowed and even in the help page

[1 2 3] | input list  # -> returns an `int`

this PR fixes the signature of input list.

  • with no option or --fuzzy, input list takes a list<any> and outputs a single any
  • with --multi, input list takes a list<any> and outputs a list<any>

User-Facing Changes

the input output signature of input list is now

  ╭───┬───────────┬───────────╮
  │ # │   input   │  output   │
  ├───┼───────────┼───────────┤
  │ 0 │ list<any> │ list<any> │
  │ 1 │ list<any> │ any       │
  ╰───┴───────────┴───────────╯

Tests + Formatting

this shouldn't change anything as [1 2 3] | input list already works.

After Submitting

@amtoine amtoine added the type-system Problems or features related to nushell's type system label Aug 10, 2023
@amtoine amtoine merged commit 23170ff into nushell:main Aug 10, 2023
19 checks passed
@amtoine amtoine deleted the fix-input-list-signature branch August 10, 2023 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-system Problems or features related to nushell's type system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants