I agree with nick, this looks like a transformation chain. Each step
On Feb 23, 2014 10:25 AM, "Ron Adam" <ron3200@gmail.com> wrote: transforming the "new" result of the previous step.
seq = []->extend(get_data())->sort()
To make it pythonic ...
The operator you want is one for an in place method call. If we apply the
"+=" pattern for the '__iadd__' method call syntax, to the more the general '.' method syntax, we get ".=", the in place method call syntax.
seq = [] seq .= extend(get_data()) # In place method call.
In place method calls seem quite reasonable to me.
And then to get the rest of the way there, allow chained "in place"
method calls.
seq = [] .= extend(get_data()) .= sort()
Which should be a separate pep from the ".=" enhancement.
BTW... allowing ".=" could mean a class could have one __iget_method__
attribute instead of multiple __ixxxx___ methods. (Or something like that.)
Cheers, Ron
I like this syntax. It easy to tell what exactly is getting mutated.