From: Jeremy Banks <jer...@jeremybanks.ca>
Date: Wed, 13 May 2009 11:52:57 -0300
Local: Wed, May 13 2009 10:52 am
Subject: Re: [Python-ideas] Default arguments in Python - the return - running out of ideas but...
To someone who's a novice to this, could someone explain to me why it
has to be an existing keyword at all? Since not identifiers are valid in that context anyway, why couldn't it be a new keyword that can still be used as an identifier in valid contexts? For example (not that I advocate this choice of keyword at all): def foo(bar reinitialize_default []): # <-- it's a keyword here That would be a syntax error now and if it were defined as a keyword Is there a reason that this wouldn't be a viable approach? On 2009-05-13, MRAB <goo...@mrabarnett.plus.com> wrote: > Jacob Holm wrote: _______________________________________________ >> Pascal Chambon wrote: >>> One last idea I might have : what about something like >>> * def myfunc(a, b, c = yield []): >>> [...], but there is no interpretation conflict for the parser, and we >> I am surprised that there is no conflict, but it looks like you are >> >>> def gen(): >> I would hate to see the meaning of the above change depending on whether >> I'm +0 on the general idea of adding a keyword for delayed evaluation of > There's the suggestion that Carl Johnson gave: > def myfunc(a, b, c else []): > or there's: > def myfunc(a, b, c def []): > where 'def' stands for 'default' (or "defaults to"). Python-ideas mailing list Python-id...@python.org http://mail.python.org/mailman/listinfo/python-ideas You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||