[issue18478] Class bodies: when does a name become local?

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests:  -13235

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +13235

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +13227

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2019-05-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests:  -13227

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2016-05-29 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The new language *and* organization introduced sometime during 3.4 is good 
enough for me. " with an exception that unbound local variables are looked up 
in the global namespace." covers my example. Thanks for the pointer.

--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2016-05-29 Thread R. David Murray

R. David Murray added the comment:

As far as I can see this has been fixed by explaining the special rules for 
class definitions at the end of the section.  Do you think there is anything 
left to do here, Terry?  Perhaps a 2.7 backport of some of the clarifications?

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2014-04-05 Thread Nitika Agarwal

Nitika Agarwal added the comment:

Hi,
I have attached the patch for the issue.Please someone review my patch.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18478
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2014-04-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

After seeing my suggestion applied, I decided I don't like it. Sorry. A 
'function code block' is a 'function suite'. A deeper problem is that the 
revision now omits the rules for classes. The base problem is that I don't know 
what the rules are when classes and functions are nested within each other 
(does anybody, without reading the code?). A puzzling example was posted on 
python-list yesterday, which I will try to find.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18478
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2014-03-16 Thread Nitika Agarwal

Nitika Agarwal added the comment:

Hi,
Please review my patch attached.

--
keywords: +patch
Added file: http://bugs.python.org/file34441/issue18478.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18478
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2014-03-15 Thread Nitika Agarwal

Nitika Agarwal added the comment:

Hey.
I am working on this patch.

--
nosy: +nitika

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18478
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2013-07-16 Thread Terry J. Reedy

New submission from Terry J. Reedy:

http://docs.python.org/3/reference/executionmodel.html#naming-and-binding
says The following are blocks: ... a class definition. and 

If a name binding operation occurs anywhere within a code block, all uses of 
the name within the block are treated as references to the current block. This 
can lead to errors when a name is used within a block before it is bound. ... 

This is definitely true for functions, but not for classes:

foo = 'bar'
class C:
foo = foo

print(C().foo)
#
bar

This is the same for 3.3 and 2.7 with and without '(object)' added. Unless the 
code is considered to be buggy (probably since forever), the doc should be 
modified to change 'code block' to 'function code block' or maybe 'module or 
function code block'. (At near as I can think, the statement is true for 
modules, but only because globals() == locals(), so that part of the issue does 
not arise.)

--
assignee: docs@python
components: Documentation
messages: 193205
nosy: docs@python, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Class bodies: when does a name become local?
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18478
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18478] Class bodies: when does a name become local?

2013-07-16 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18478
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com