[issue26093] __qualname__ different when calling generator object w/ functions.partial
Dino Viehland
report at bugs.python.org
Tue Jan 12 17:33:48 EST 2016
New submission from Dino Viehland:
import functools
def f():
def g():
yield 1
return g
functools.partial(f())().__qualname__ != f()().__qualname__
The qualified name gets passed in via the interpreter loop with _PyEval_EvalCodeWithName calling PyGen_NewWithQualName. If a generator object gets called from C then the qualified name gets lost.
It seems like _PyEval_EvalCodeWithName shouldn't exist and the generator code object should be able to get back to its qualified name so subtle differences like this don't happen.
----------
components: Interpreter Core
messages: 258119
nosy: dino.viehland
priority: normal
severity: normal
status: open
title: __qualname__ different when calling generator object w/ functions.partial
type: behavior
versions: Python 3.5
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26093>
_______________________________________
More information about the Python-bugs-list
mailing list