A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-August/068125.html below:

[Python-Dev] SyntaxError: can't assign to function call

[Python-Dev] SyntaxError: can't assign to function callJames Y Knight foom at fuhm.net
Thu Aug 10 20:28:20 CEST 2006
On Aug 10, 2006, at 12:24 PM, Guido van Rossum wrote:
> On 8/10/06, James Y Knight <foom at fuhm.net> wrote:
>> It makes just as much sense as assigning to an array access, and the
>> semantics would be pretty similar.
>
> No. Array references (x[i]) and attribute references (x.a) represent
> "locations". Function calls represent values. This is no different
> than the distinction between lvalues and rvalues in C.

Yes, function calls cannot be lvalues right now. However, there is no  
reason that a function call _could not_ be an lvalue. That is exactly  
what the addition of __setcall__  would allow.


On Aug 10, 2006, at 12:31 PM, Phillip J. Eby wrote:
> Honestly, it might make more sense to get rid of augmented  
> assignment in Py3K rather than to add this.  It seems that the need  
> for something like this springs primarily from the existence of  
> augmented assignment.

It makes just as much (and just as little) sense to have normal  
assignment to function calls as it does augmented assignment to  
function calls. I don't see any reason to single out augmented  
assignment here.

Anyhow, enough time wasted on this. I don't really think python  
should add this feature, but it _does_ make sense, and would have  
understandable and consistent semantics if it were added.

James
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4