Verbose and flexible args and kwargs syntax

Discussion in 'Python' started by Eelco Hoogendoorn, Dec 12, 2011.

  1. > The above examples are seldom needed in Python because we have one
    > general method to repeatedly split a sequence into head and tail.


    > it = iter(iterable) # 'it' now represents the sequenced iterable
    > head = next(it) # 'it' now represents the tail after removing the head


    > In other words, next(it) encompasses all of your examples and many more.
    > Because 'it' is mutated to represent the tail, it does not need to be
    > rebound and therefore is not.



    The question in language design is never 'could we do these things
    before'. The answer is obvious: yes our CPUs are turing complete; we can
    do anything. The question is; how would we like to do them?

    So do you think the new head/tail unpacking features in python 3 are
    entirely uncalled for? I personally quite like them, but I would like
    them to be more general.
    Eelco Hoogendoorn, Dec 12, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eelco Hoogendoorn

    Verbose and flexible args and kwargs syntax

    Eelco Hoogendoorn, Dec 11, 2011, in forum: Python
    Replies:
    1
    Views:
    240
    Steven D'Aprano
    Dec 11, 2011
  2. Eelco Hoogendoorn

    Verbose and flexible args and kwargs syntax

    Eelco Hoogendoorn, Dec 11, 2011, in forum: Python
    Replies:
    0
    Views:
    154
    Eelco Hoogendoorn
    Dec 11, 2011
  3. Eelco Hoogendoorn

    Verbose and flexible args and kwargs syntax

    Eelco Hoogendoorn, Dec 11, 2011, in forum: Python
    Replies:
    0
    Views:
    176
    Eelco Hoogendoorn
    Dec 11, 2011
  4. Eelco Hoogendoorn

    Verbose and flexible args and kwargs syntax

    Eelco Hoogendoorn, Dec 11, 2011, in forum: Python
    Replies:
    88
    Views:
    1,032
    Grant Edwards
    Dec 17, 2011
  5. Eelco Hoogendoorn

    Verbose and flexible args and kwargs syntax

    Eelco Hoogendoorn, Dec 11, 2011, in forum: Python
    Replies:
    0
    Views:
    155
    Eelco Hoogendoorn
    Dec 11, 2011
Loading...

Share This Page