PEP 3104 says:
"""
A shorthand form is also permitted, in which nonlocal is prepended to
an assignment or augmented assignment:
nonlocal x = 3
The above has exactly the same meaning as nonlocal x; x = 3. (Guido
supports a similar form of the global statement [24].)
"""
The PEP metadata says it
On Fri, Jan 5, 2018 at 1:57 AM, Nathaniel Smith wrote:
> PEP 3104 says:
>
> """
> A shorthand form is also permitted, in which nonlocal is prepended to
> an assignment or augmented assignment:
>
> nonlocal x = 3
>
> The above has exactly the same meaning as nonlocal x; x = 3. (Guido
> supports a
On Fri, Jan 5, 2018, at 10:47, Guido van Rossum wrote:
> I don't recall (though someone with more time might find the discussion in
> the archives or on the tracker). It was never implemented and I think it
> shouldn't be. So we might as well update the PEP. It wouldn't be
> particularly useful, si
Yeah, but I've changed my mind on this -- I think it's needless added
complexity that helps save one line of code in very few use cases. And you
don't really think the PEP endorses `nonlocal foo += 1` do you?
On Fri, Jan 5, 2018 at 10:48 AM, Random832 wrote:
> On Fri, Jan 5, 2018, at 10:47, Guid
On Fri, Jan 5, 2018 at 7:47 AM, Guido van Rossum wrote:
> I don't recall (though someone with more time might find the discussion in
> the archives or on the tracker). It was never implemented and I think it
> shouldn't be. So we might as well update the PEP. It wouldn't be
> particularly useful,
I don't like those examples -- "nonlocal foo = bar" sounds like bar is used
as the *initializer*, but it actually is just an assignment that overwrites
the actual initial value. IMO those shouldn't be combined.
On Fri, Jan 5, 2018 at 2:59 PM, Nathaniel Smith wrote:
> On Fri, Jan 5, 2018 at 7:47
On 5 January 2018 at 23:02, Guido van Rossum wrote:
> I don't like those examples -- "nonlocal foo = bar" sounds like bar is used
> as the *initializer*, but it actually is just an assignment that overwrites
> the actual initial value. IMO those shouldn't be combined.
That was my immediate reacti
On Fri, Jan 5, 2018, at 01:57, Nathaniel Smith wrote:
> Was this just an oversight, or did it get rejected at some point and
> no-one remembered to update that PEP?
There was an implementation https://bugs.python.org/issue4199. But several
years ago, we again reached the conclusion that the fe
Maybe we should not delete them outright but add something like "(UPDATE:
during later discussions it was decided that this feature shouldn't be
added.)"
On Fri, Jan 5, 2018 at 10:52 PM, Benjamin Peterson
wrote:
>
>
> On Fri, Jan 5, 2018, at 01:57, Nathaniel Smith wrote:
> > Was this just an ove
On Jan 6, 2018, at 11:43, Guido van Rossum wrote:
>
> Maybe we should not delete them outright but add something like "(UPDATE:
> during later discussions it was decided that this feature shouldn't be
> added.)"
+1
-Barry
signature.asc
Description: Message signed with OpenPGP
_
On Fri, Jan 5, 2018, at 14:07, Guido van Rossum wrote:
> Yeah, but I've changed my mind on this -- I think it's needless added
> complexity that helps save one line of code in very few use cases. And you
> don't really think the PEP endorses `nonlocal foo += 1` do you?
The PEP itself is very clear
https://github.com/python/peps/commit/2d2ac2d2b66d4e37e8b930f5963735616bddbbe8
On Sat, Jan 6, 2018, at 08:56, Barry Warsaw wrote:
> On Jan 6, 2018, at 11:43, Guido van Rossum wrote:
> >
> > Maybe we should not delete them outright but add something like "(UPDATE:
> > during later discussions it
12 matches
Mail list logo