[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?
- From: Coda Highland <chighland@...>
- Date: Mon, 8 Jun 2015 21:19:39 -0700
On Mon, Jun 8, 2015 at 9:02 PM, Parke <parke.nexus@gmail.com> wrote:
> On Mon, Jun 8, 2015 at 7:37 PM, Coda Highland <chighland@gmail.com> wrote:
>> Worse, [Python's local-by-default] makes upvalues very challenging, as they are neither local
>> nor global yet no way exists to explicitly target them in Python 2.x.
>> (If you try to assign to an upvalue, you instead create a new local
>> that shadows it!)
>
> Is this fixed in Python 3.x?
>
> In any case, it is not inherently a problem with local-by-default
> (which I prefer). There could be a way to assign to upvalues. Python
> (at least Python 2.x) just lacks such a mechanism.
>
> -Parke
>
Yes, Python 3.x introduces a "nonlocal" keyword which binds the name
to the nearest upvalue with that name.
/s/ Adam
- References:
- how to call a local function by its name?, Dmitry V. Zaitsev
- Re: how to call a local function by its name?, Paul K
- Re: how to call a local function by its name?, Brigham Toskin
- Re: how to call a local function by its name?, Dmitry Zaitsev
- Re: how to call a local function by its name?, Brigham Toskin
- Re: how to call a local function by its name?, Milind Gupta
- Re: how to call a local function by its name?, Oliver Kroth
- [Proposal] _LOCAL was: Re: how to call a local function by its name?, Soni L.
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Soni L.
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Coda Highland
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Soni L.
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Coda Highland
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Soni L.
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Coda Highland
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Coda Highland
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Rena
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Coda Highland
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Rena
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Coda Highland
- Re: [Proposal] _LOCAL was: Re: how to call a local function by its name?, Parke