[Python-ideas] add fluent operator to everything

Dan Sommers 2QdxY4RzWzUUiLuE at potatochowder.com
Thu Feb 21 00:27:55 EST 2019


On 2/20/19 7:46 PM, Christopher Barker wrote:

 > mutating operations vs copying operations
 >
 > functions vs methods.
 >
 > This has a lot of impact on the design, and it's very important that
 > any final syntax makes these distinctions clear.

Absolutely.

 > On Wed, Feb 20, 2019 at 8:33 AM Dan Sommers
 > <2QdxY4RzWzUUiLuE at potatochowder.com> wrote:

 > > It's a different way of doing things.  Please don't conflate them.
 >
 > however, that's kind of what this thread is all about :-)

And I'm objecting to it.  :-)

 > So is the goal here to get "fluent" syntax for stringing mutating
 > operations together that mutate the object?

Not my goal, no.

 > ... we should extend the mutable sequence
 > ABC with methods that return new objects:
 >
 > list.sorted()
 > list.appended()
 > list.extended()

Call me +0, or maybe +0.5 if adding such additional methods prevent
adding new syntax.

Dan


More information about the Python-ideas mailing list