[issue23113] Compiler doesn't recognize qualified exec('', {})

2014-12-25 Thread John Firestone
New submission from John Firestone: Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type help, copyright, credits or license for more information. def outer(): ... def inner(arg): ... len(arg) ... exec

[issue23113] Compiler doesn't recognize qualified exec('', {})

2014-12-25 Thread John Firestone
John Firestone added the comment: Sorry. Duplicates 21591 -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23113

[issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

2012-06-18 Thread John Firestone
New submission from John Firestone jo...@freenet.de: exec(source, Dict()) doesn't call Dict().__getitem__ or Dict().__missing__ if the source string contains a function and the function references an undefined global. class Dict1(dict): def __getitem__(self, key): print

[issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

2012-06-18 Thread John Firestone
John Firestone jo...@freenet.de added the comment: I find the behavior inconsistent. As you can see from this example, the exec'uted code *does* call the instance's overloaded __getitem__ and __missing__ methods when outside a function, but doesn't when inside

[issue15099] exec of function doesn't call __getitem__ or __missing__ on undefined global

2012-06-18 Thread John Firestone
John Firestone jo...@freenet.de added the comment: Thank you all for the quick and interesting responses! Here is another example, this time showing a simple s sometimes behaves like globals()['s'] and sometimes doesn't. class Dict(dict): def __getitem__(self, key): if key

[issue3454] __getitem__() doesn't capture all slices if class inherits from list, tuple or str

2008-07-27 Thread John Firestone
Changes by John Firestone [EMAIL PROTECTED]: -- components: Interpreter Core files: getitem_problem.py nosy: johnf severity: normal status: open title: __getitem__() doesn't capture all slices if class inherits from list, tuple or str type: performance versions: Python 2.5 Added file