Search code examples
pythonpython-2.7python-3.xcpython

Reproduce effects of Python 3.3 __qualname__ in earlier Pythons


Python 3.3 added the __qualname__ attribute which allows people to get the qualified name of a function (think module.submodule.class.function) or similar.

Is there a way to reproduce this attribute in Python 2.6 and 2.7?


Solution

  • I've written a library that provides a __qualname__ equivalent for older Python versions: https://github.com/wbolster/qualname