[issue42050] ensurepip fails if cwd contains illformed setup.cf

2021-01-30 Thread Jan Christoph
Jan Christoph added the comment: Just wanted to say, I ran into this while using direnv. See the issue I opened before knowing of this one: https://bugs.python.org/issue43038 -- nosy: +con-f-use Added file: https://bugs.python.org/file49779/shell-session.txt

[issue43038] ensurepip: tries to use setup.py/setup.cfg

2021-01-27 Thread Jan Christoph
New submission from Jan Christoph : Running python3 -Im ensurepip --upgrade --default-pip in a directory that contains a setup.cfg / setup.py combination, caused ensurepip to try and use these files, leading to distutils.errors.DistutilsOptionError: error in setup.cfg: command 'build' has

[issue27793] Double underscore variables in module are mangled when used in class

2020-03-06 Thread Jan Christoph
Jan Christoph added the comment: In particular, this might conflict with the documentation of global, which states: > If the target is an identifier (name): > >If the name does not occur in a global statement in the current code > block: the name is bound to the object in

[issue27793] Double underscore variables in module are mangled when used in class

2020-03-04 Thread Jan Christoph
Jan Christoph added the comment: Just because it is documented, doesn't mean it's not a bug or illogical and unexpected. -- ___ Python tracker <https://bugs.python.org/issue27

[issue27793] Double underscore variables in module are mangled when used in class

2020-03-04 Thread Jan Christoph
Jan Christoph added the comment: I would argue to reopen this. Seeing I and other people run into that issue (e.g. https://stackoverflow.com/q/40883083/789308) quiet frequently. Especially since it breaks the `global` keyword, e.g.: __superprivate = "mahog" class AClass(object

[issue34076] Nested loop in dictionary comprehension gives `global name not defined` inside class

2018-07-10 Thread Jan Christoph
Jan Christoph added the comment: Updated example with reversed variable order for reference. This really seems to be related to issue3692, but really not the same thing. IMHO both `a` and `b` should be passed in a situation like this: a = range(5) b = range(3) c = [x+y for x in a for y

[issue34076] Nested loop in dictionary comprehension gives `global name not defined` inside class

2018-07-10 Thread Jan Christoph
Jan Christoph added the comment: Okay, so we're a in another scope inside the dictionary comprehension (all comprehensions for that matter), and only one symbol is passed to the inside. That's why `strange_reversed_working = {x+s.replace('(+/-)',''):None for x in infts.split(', ') for s

[issue34076] Nested loop in dictionary comprehension gives `global name not defined` inside class

2018-07-10 Thread Jan Christoph
Jan Christoph added the comment: But the simpler dictionary compprehension `{s.replace('(+/-)',''):None for s in infts.split(', ')}` works perfectly. Shouldn't that also give the error if it was a scope issue? -- ___ Python tracker <ht

[issue34076] Nested loop in dictionary comprehension gives `global name not defined` inside class

2018-07-09 Thread Jan Christoph
New submission from Jan Christoph : The python code: ``` class _tri(object): infts = '(+/-)inf, (+/-)infty, (+/-)infinity' strange_failing = {x+s.replace('(+/-)',''):None for x in ('+','-','') for s in infts.split(', ')} ``` gives a `global name 'infts' is not defined` exception