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

Josiah Carlson jcarlson at uci.edu
Thu Aug 10 18:01:47 CEST 2006


"Michael Urman" <murman at gmail.com> wrote:
> 
> On 8/9/06, Michael Hudson <mwh at python.net> wrote:
> > The question doesn't make sense: in Python, you assign to a name,
> > an attribute or a subscript, and that's it.
> 
> Just to play devil's advocate here, why not to a function call via a
> new __setcall__? I'm not saying there's the use case to justify it,
> but I don't see anything that makes it a clear abomination or
> impossible with python's syntax.

Describe the syntax and semantics.  Every time I try to work them out, I
end up with a construct that makes less than no sense, to be used in
cases I have never seen. Further, if you want to call a method
__setcall__ on an object just created, you can use 'x().__setcall__(y)'.
There is no reason to muck up Python's syntax.


 - Josiah



More information about the Python-Dev mailing list