mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
GH-101100: Fix reference warnings for `namedtuple
` (#110113)
This commit is contained in:
parent
613c0d4e86
commit
cbdacc738a
2 changed files with 4 additions and 4 deletions
|
@ -1850,8 +1850,8 @@ changes, or look through the Subversion logs for all the details.
|
||||||
special values and floating-point exceptions in a manner consistent
|
special values and floating-point exceptions in a manner consistent
|
||||||
with Annex 'G' of the C99 standard.
|
with Annex 'G' of the C99 standard.
|
||||||
|
|
||||||
* A new data type in the :mod:`collections` module: :class:`namedtuple(typename,
|
* A new data type in the :mod:`collections` module: ``namedtuple(typename, fieldnames)``
|
||||||
fieldnames)` is a factory function that creates subclasses of the standard tuple
|
is a factory function that creates subclasses of the standard tuple
|
||||||
whose fields are accessible by name as well as index. For example::
|
whose fields are accessible by name as well as index. For example::
|
||||||
|
|
||||||
>>> var_type = collections.namedtuple('variable',
|
>>> var_type = collections.namedtuple('variable',
|
||||||
|
@ -1873,7 +1873,7 @@ changes, or look through the Subversion logs for all the details.
|
||||||
variable(id=1, name='amplitude', type='int', size=4)
|
variable(id=1, name='amplitude', type='int', size=4)
|
||||||
|
|
||||||
Several places in the standard library that returned tuples have
|
Several places in the standard library that returned tuples have
|
||||||
been modified to return :class:`namedtuple` instances. For example,
|
been modified to return :func:`namedtuple` instances. For example,
|
||||||
the :meth:`Decimal.as_tuple` method now returns a named tuple with
|
the :meth:`Decimal.as_tuple` method now returns a named tuple with
|
||||||
:attr:`sign`, :attr:`digits`, and :attr:`exponent` fields.
|
:attr:`sign`, :attr:`digits`, and :attr:`exponent` fields.
|
||||||
|
|
||||||
|
|
|
@ -380,7 +380,7 @@ Implement :pep:`572` (assignment expressions). Patch by Emily Morehouse.
|
||||||
.. nonce: voIdcp
|
.. nonce: voIdcp
|
||||||
.. section: Core and Builtins
|
.. section: Core and Builtins
|
||||||
|
|
||||||
Speed up :class:`namedtuple` attribute access by 1.6x using a C fast-path
|
Speed up :func:`namedtuple` attribute access by 1.6x using a C fast-path
|
||||||
for the name descriptors. Patch by Pablo Galindo.
|
for the name descriptors. Patch by Pablo Galindo.
|
||||||
|
|
||||||
..
|
..
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue