[Python-ideas] Dart-like method cascading operator in Python

Chris Angelico rosuav at gmail.com
Fri Nov 22 00:15:36 CET 2013


On Fri, Nov 22, 2013 at 10:09 AM, Masklinn <masklinn at masklinn.net> wrote:
> On 2013-11-21, at 23:53 , Andrew Barnert <abarnert at yahoo.com> wrote:
>> On Nov 21, 2013, at 11:10, Masklinn <masklinn at masklinn.net> wrote:
>>>> So if this is any part of the argument for the proposal, I'm -1.
>>>
>>> As far as there’s any interest to cascading it’s that it’s terser
>>> than sequencing calls with explicit receivers, and that it’s an
>>> expression allowing inline initialisation sequences and not requiring
>>> creating a binding.
>>
>> Are you actually using the word “expression" in it's usual programming-language meaning here?
>
> I fail to see what other sense there would be.

An expression, in programming languages, has a value - you can use it
as a function parameter, etc. In Python, assignment is NOT an
expression, although it kinda looks like one (having two operands and
a symbol between them, chained assignment aside). The original
proposal definitely worked with a suite of statements and was not
restricted to expressions.

ChrisA


More information about the Python-ideas mailing list