From 3099ae407541b63249657b971fb35ff217508d86 Mon Sep 17 00:00:00 2001 From: Andre Delfino Date: Mon, 20 May 2019 21:52:17 -0300 Subject: [PATCH] Remove workaround for defaults in namedtuple now that we have the defaults parameter (GH-13263) --- Doc/library/collections.rst | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index e0469c20810..ae21db216fd 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -1017,15 +1017,6 @@ fields: .. versionchanged:: 3.5 Property docstrings became writeable. -Default values can be implemented by using :meth:`~somenamedtuple._replace` to -customize a prototype instance: - - >>> Account = namedtuple('Account', 'owner balance transaction_count') - >>> default_account = Account('', 0.0, 0) - >>> johns_account = default_account._replace(owner='John') - >>> janes_account = default_account._replace(owner='Jane') - - .. seealso:: * See :class:`typing.NamedTuple` for a way to add type hints for named