[Python-Dev] Shortcut Notation for Chaining Method Calls

Terry Reedy tjreedy at udel.edu
Sat Feb 3 20:55:54 CET 2007


<dustin at v.igoro.us> wrote in message 
news:20070203193952.GG31813 at v.igoro.us...
| On Sat, Feb 03, 2007 at 07:01:47PM +0000, Michael O\'Keefe wrote:
| I haven't been on the list long enough to know, but I would expect that 
this
| idea and its relatives have been batted around at least once before.

Of course.

| I think a
| lot of people have been frustrated at the repetitive nature of operations 
on
| lists, for example, as you indicated in your first post.  I think there's 
room
| for debate on whether specific list methods that currently return None 
should
| instead return the list, although I would definitely consult the archives
| before entering that fray.

The current design of having mutation methods return None is Guido's 
explicit, intentional, conscious, and repeatedly affirmed design choice. 
He is convinced that the pain of repetition is worth the reduction of bugs 
that would happen when people forget that a list (self) -returning method 
also mutates.  I think comp.lang.python would be a better place for debate.

tjr





More information about the Python-Dev mailing list