[Python-Dev] Shortcut Notation for Chaining Method Calls

Nick Coghlan ncoghlan at gmail.com
Sun Feb 4 01:51:09 CET 2007


Michael O'Keefe wrote:
> I'm sure there are other ways to do this as well but what do people
> think? Has something like this come up before?

Yes, this has come up before, and list.sort and list.reverse were 
identified as the methods people were most likely to want to chain. The 
sorted() and reversed() builtins were the result.

Also, the spelling you propose creates a horrible confusion when calling 
a method which already has a real return value (like list.pop).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-Dev mailing list