[Python-ideas] Before and after the colon in funciton defs.

Jakob Bowyer jkbbwr at gmail.com
Thu Sep 22 23:07:07 CEST 2011

Sorry Im still a bit new to all this, what would be the specific
advantage of having this?

On 9/22/11, Paul Moore <p.f.moore at gmail.com> wrote:
> On 22 September 2011 15:34, Paul Moore <p.f.moore at gmail.com> wrote:
>> I think that based on your definition, all my "but what about X"
>> pathological examples have reasonably sane behaviours (you need a good
>> understanding of what "definition time" actually means, but once you
>> internalise the fact that def is an executable statement, that isn't
>> too hard).
> I spotted one that might still be worth mentioning, though.
> a = 10
> def foo():
>     a = 20
>     b = static a
> What should that mean? Clearly b isn't 20, as a wasn't set to 20 at
> function define time. But b = 10 (on the assumption that "static a"
> takes the value of a at define time) will confusing to users, I would
> suggest. Not allowed might be best, but I suspect it could be hard to
> implement.
> But as Guido's -1 on the expression form, this is probably moot.
> Paul.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas

More information about the Python-ideas mailing list