[Python-Dev] can't assign to function call (original) (raw)
Guido van Rossum guido at python.org
Mon Mar 18 18:57:56 CET 2013
- Previous message: [Python-Dev] can't assign to function call
- Next message: [Python-Dev] can't assign to function call
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Move. This. Thread. Out. Of. Python-Dev. Now. (python-ideas is the right place.)
On Mon, Mar 18, 2013 at 10:25 AM, Serhiy Storchaka <storchaka at gmail.com> wrote:
On 18.03.13 17:40, Steven D'Aprano wrote:
On 19/03/13 02:01, Hrvoje Niksic wrote:
Assigning to function calls is orthogonal to reference types. For example, Python manages assignment to subscripts without having references just fine: val = obj[index] # val = obj.getitem(index) obj[index] = val # obj.setitem(index, val) In analogy with that, Python could implement what looks like assignment to function call like this: val = f(arg) # val = f.call(arg) f(arg) = val # f.setcall(arg, val) That's all very well, but what would it do? It's not enough to say that the syntax could exist, we also need to have semantics. What's the use-case here? (That question is mostly aimed at the original poster.) Python could use parenthesis instead of brackets for indexing and a dictionary lookup. However it is too late to discuss this idea.
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
-- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-Dev] can't assign to function call
- Next message: [Python-Dev] can't assign to function call
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]