Feature request: unpack
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 280
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 4
Description
This is similar to itertools.starmap but without the map part. It would allow the following:
pipe(
data,
unpack(f), # ---> call f(*args) instead of f(args)
list
)
Currently you need to do it via lambda:
data = ((1, 2, 3, 4), ('a', 'b', 'c', 'd'), ('🤔', '🙈', '😌', '💕'))
pipe(
data,
lambda x: zip(*x),
list
)
# [(1, 'a', '🤔'), (2, 'b', '🙈'), (3, 'c', '😌'), (4, 'd', '💕')]
Also requested in funcy and StackOverflow
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing itertools.starmap-equivalent utilities and their tests, then compare their calling conventions with the proposed unpack(f) usage. Done means the new transformation supports positional unpacking in a pipe and has tests covering the example behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100