Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Verbose and flexible args and kwargs syntax

Reply
Thread Tools

Verbose and flexible args and kwargs syntax

 
 
Eelco Hoogendoorn
Guest
Posts: n/a
 
      12-12-2011
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Verbose and flexible args and kwargs syntax Eelco Hoogendoorn Python 88 12-17-2011 08:02 PM
Verbose and flexible args and kwargs syntax Eelco Hoogendoorn Python 0 12-11-2011 11:53 PM
Verbose and flexible args and kwargs syntax Eelco Hoogendoorn Python 1 12-11-2011 10:19 PM
Verbose and flexible args and kwargs syntax Eelco Hoogendoorn Python 0 12-11-2011 02:58 PM
Verbose and flexible args and kwargs syntax Eelco Hoogendoorn Python 0 12-11-2011 02:44 PM



Advertisments