Skip to content

spam #134131

Not planned
Not planned
spam#134131
@jabari-max

Description

@jabari-max

The attached patch adds the missing *-unpacking generalizations.
Specifically:

>> a, b, *c = range(5)

>> *a, b, c = a, b, *c
>> a, b, c
([0, 1, 2], 3, 4)
>> [ *a, b, c ]
[0, 1, 2, 3, 4]
>> L = [ a, (3, 4), {5}, {6: None}, (i for i in range(7, 10)) ]
>> [ *item for item in L ]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Also, yielding everything from an iterator:

>> def flatten(iterables):
...     for it in iterables:
...         yield *it
... 
>> L = [ a, (3, 4), {5}, {6: None}, (i for i in range(7, 10)) ]
>> flatten(L)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Originally posted by @Yhg1s in #46545

Activity

ronaldoussoren

ronaldoussoren commented on May 17, 2025

@ronaldoussoren
Contributor

Please don't spam

changed the title [-]i'm just[/-] [+]spam[/+] on May 17, 2025
locked as spam and limited conversation to collaborators on May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      spam · Issue #134131 · python/cpython

      Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

      Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant