diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-06-16 13:59:28 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-06-16 13:59:28 (GMT) |
commit | 40ee30181f7f7c71d6b49ceef35b5d3d20b88a6d (patch) | |
tree | 4f6813c9aff51c1f467504698456c7c4a1c33244 /Doc/whatsnew | |
parent | 26171993fe629c614e62c7aef1196c0f53a30d85 (diff) | |
download | cpython-40ee30181f7f7c71d6b49ceef35b5d3d20b88a6d.zip cpython-40ee30181f7f7c71d6b49ceef35b5d3d20b88a6d.tar.gz cpython-40ee30181f7f7c71d6b49ceef35b5d3d20b88a6d.tar.bz2 |
Issue #21205: Add a new ``__qualname__`` attribute to generator, the qualified
name, and use it in the representation of a generator (``repr(gen)``). The
default name of the generator (``__name__`` attribute) is now get from the
function instead of the code. Use ``gen.gi_code.co_name`` to get the name of
the code.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.5.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.5.rst b/Doc/whatsnew/3.5.rst index b5536ad..17b703a 100644 --- a/Doc/whatsnew/3.5.rst +++ b/Doc/whatsnew/3.5.rst @@ -304,6 +304,12 @@ Changes in the Python API or :exc:`ssl.SSLWantWriteError` on a non-blocking socket if the operation would block. Previously, it would return 0. See :issue:`20951`. +* The ``__name__`` attribute of generator is now set from the function name, + instead of being set from the code name. Use ``gen.gi_code.co_name`` to + retrieve the code name. Generators also have a new ``__qualname__`` + attribute, the qualified name, which is now used for the representation + of a generator (``repr(gen)``). See :issue:`21205`. + Changes in the C API -------------------- |