[New-bugs-announce] [issue34475] functools.partial objects have no __qualname__ attribute

Chris Jerdonek report at bugs.python.org
Thu Aug 23 10:25:59 EDT 2018


New submission from Chris Jerdonek <chris.jerdonek at gmail.com>:

functools.partial objects have no __qualname__ attribute. This means, for example, that code expecting a callable that logs the __qualname__ attribute can break when passed a functools.partial object.

Example:

>>> import functools
>>> int.__qualname__
'int'
>>> p = functools.partial(int)
>>> p.__qualname__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'functools.partial' object has no attribute '__qualname__'

----------
components: Library (Lib)
messages: 323947
nosy: chris.jerdonek
priority: normal
severity: normal
status: open
title: functools.partial objects have no __qualname__ attribute
type: enhancement
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34475>
_______________________________________


More information about the New-bugs-announce mailing list