Re: [Python-Dev] nonlocal x = value

2010-12-27 Thread Georg Brandl
Am 27.12.2010 10:43, schrieb Raymond Hettinger: > FWIW, I'm entirely opposed to doing an assignment in a nonlocal definition. > > * It is easily mis-parsed by human (as shown by Georg's examples). > * It looks very much like an initialization of a local variable in many > languages, > but it i

Re: [Python-Dev] nonlocal x = value

2010-12-27 Thread Nick Coghlan
On Mon, Dec 27, 2010 at 8:31 PM, Mark Dickinson wrote: > On Mon, Dec 27, 2010 at 9:43 AM, Raymond Hettinger > wrote: >> FWIW, I'm entirely opposed to doing an assignment in a nonlocal definition. >> [...] > > -1 for assignment in nonlocal and global statements from me, too. Indeed. The PEP shoul

Re: [Python-Dev] nonlocal x = value

2010-12-27 Thread Mark Dickinson
On Mon, Dec 27, 2010 at 9:43 AM, Raymond Hettinger wrote: > FWIW, I'm entirely opposed to doing an assignment in a nonlocal definition. > [...] -1 for assignment in nonlocal and global statements from me, too. Mark ___ Python-Dev mailing list Python-De

Re: [Python-Dev] nonlocal x = value

2010-12-27 Thread Raymond Hettinger
On Dec 25, 2010, at 2:59 AM, Stefan Behnel wrote: > Hrvoje Niksic, 24.12.2010 09:45: >> On 12/23/2010 10:03 PM, Laurens Van Houtven wrote: >>> On Thu, Dec 23, 2010 at 9:51 PM, Georg Brandl wrote: Yes and no -- there may not be an ambiguity to the parser, but still to the human. Except i

Re: [Python-Dev] nonlocal x = value

2010-12-25 Thread Stefan Behnel
Hrvoje Niksic, 24.12.2010 09:45: On 12/23/2010 10:03 PM, Laurens Van Houtven wrote: On Thu, Dec 23, 2010 at 9:51 PM, Georg Brandl wrote: Yes and no -- there may not be an ambiguity to the parser, but still to the human. Except if you disallow the syntax in any case, requiring people to write n

Re: [Python-Dev] nonlocal x = value

2010-12-24 Thread Hrvoje Niksic
On 12/23/2010 10:03 PM, Laurens Van Houtven wrote: On Thu, Dec 23, 2010 at 9:51 PM, Georg Brandl wrote: Yes and no -- there may not be an ambiguity to the parser, but still to the human. Except if you disallow the syntax in any case, requiring people to write nonlocal x = (3, y) which i

Re: [Python-Dev] nonlocal x = value

2010-12-23 Thread Georg Brandl
Am 23.12.2010 22:03, schrieb Laurens Van Houtven: > On Thu, Dec 23, 2010 at 9:51 PM, Georg Brandl wrote: >> Yes and no -- there may not be an ambiguity to the parser, but still to >> the human. Except if you disallow the syntax in any case, requiring >> people to write >> >> nonlocal x = (3, y) >

Re: [Python-Dev] nonlocal x = value

2010-12-23 Thread Laurens Van Houtven
On Thu, Dec 23, 2010 at 9:51 PM, Georg Brandl wrote: > Yes and no -- there may not be an ambiguity to the parser, but still to > the human.  Except if you disallow the syntax in any case, requiring > people to write > > nonlocal x = (3, y) > > which is then again inconsistent with ordinary assignm

Re: [Python-Dev] nonlocal x = value

2010-12-23 Thread Georg Brandl
Am 22.12.2010 23:11, schrieb Laurens Van Houtven: > On Sat, Dec 18, 2010 at 1:12 PM, Georg Brandl wrote: >> Am 17.12.2010 17:52, schrieb Laurens Van Houtven: >>> +1 for throwing it out of the PEP. Assignment is a thing, >>> nonlocal/global is a thing, don't mix them up :) (That in addition to >>>

Re: [Python-Dev] nonlocal x = value

2010-12-22 Thread Terry Reedy
On 12/22/2010 5:11 PM, Laurens Van Houtven wrote: On Sat, Dec 18, 2010 at 1:12 PM, Georg Brandl wrote: Am 17.12.2010 17:52, schrieb Laurens Van Houtven: +1 for throwing it out of the PEP. Assignment is a thing, nonlocal/global is a thing, don't mix them up :) (That in addition to the grammar c

Re: [Python-Dev] nonlocal x = value

2010-12-22 Thread Laurens Van Houtven
On Sat, Dec 18, 2010 at 1:12 PM, Georg Brandl wrote: > Am 17.12.2010 17:52, schrieb Laurens Van Houtven: >> +1 for throwing it out of the PEP. Assignment is a thing, >> nonlocal/global is a thing, don't mix them up :) (That in addition to >> the grammar cleanliness argument Stephan already made) >

Re: [Python-Dev] nonlocal x = value

2010-12-18 Thread Georg Brandl
Am 17.12.2010 17:52, schrieb Laurens Van Houtven: > +1 for throwing it out of the PEP. Assignment is a thing, > nonlocal/global is a thing, don't mix them up :) (That in addition to > the grammar cleanliness argument Stephan already made) The trouble is what to make of nonlocal x = 3, y Is it tw

Re: [Python-Dev] nonlocal x = value

2010-12-17 Thread Alexander Belopolsky
On Fri, Dec 17, 2010 at 12:33 PM, Benjamin Peterson wrote: .. >> Another +1 for the same reasons.  Also, since global does not allow >> assignment, neither should nonlocal. > > Note that the PEP stated that global would also be extended. I missed that, so for future reference, the PEP says: """

Re: [Python-Dev] nonlocal x = value

2010-12-17 Thread Benjamin Peterson
2010/12/17 Alexander Belopolsky : > On Fri, Dec 17, 2010 at 11:52 AM, Laurens Van Houtven > wrote: >> +1 for throwing it out of the PEP. Assignment is a thing, >> nonlocal/global is a thing, don't mix them up :) (That in addition to >> the grammar cleanliness argument Stephan already made) > > An

Re: [Python-Dev] nonlocal x = value

2010-12-17 Thread Alexander Belopolsky
On Fri, Dec 17, 2010 at 11:52 AM, Laurens Van Houtven wrote: > +1 for throwing it out of the PEP. Assignment is a thing, > nonlocal/global is a thing, don't mix them up :) (That in addition to > the grammar cleanliness argument Stephan already made) Another +1 for the same reasons. Also, since g

Re: [Python-Dev] nonlocal x = value

2010-12-17 Thread Laurens Van Houtven
+1 for throwing it out of the PEP. Assignment is a thing, nonlocal/global is a thing, don't mix them up :) (That in addition to the grammar cleanliness argument Stephan already made) cheers lvh. ___ Python-Dev mailing list Python-Dev@python.org http://ma

Re: [Python-Dev] nonlocal x = value

2010-12-17 Thread Benjamin Peterson
2010/12/17 Stefan Behnel : > Hi, > > it seems that Py3 doesn't support setting a "nonlocal" value as part of the > "nonlocal" command > >    Python 3.2a4+ (py3k:86480, Nov 16 2010, 16:43:22) >    [GCC 4.4.3] on linux2 >    Type "help", "copyright", "credits" or "license" for more information. >    

[Python-Dev] nonlocal x = value

2010-12-16 Thread Stefan Behnel
Hi, it seems that Py3 doesn't support setting a "nonlocal" value as part of the "nonlocal" command Python 3.2a4+ (py3k:86480, Nov 16 2010, 16:43:22) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def x(): ... y = 5 ...