Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue36321

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Fix misspelled attribute name in namedtuple()
Type:behaviorStage:resolved
Components:Library (Lib)Versions:Python 3.8, Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: rhettingerNosy List: rhettinger
Priority:normalKeywords:patch

Created on2019-03-16 20:21 byrhettinger, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 12375mergedrhettinger,2019-03-16 20:43
PR 12395mergedmiss-islington,2019-03-18 07:27
PR 16858mergedrhettinger,2019-10-20 04:53
Messages (4)
msg338096 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-03-16 20:21
The attribute name, '_fields_defaults' was misspelled and should have been ''_field_defaults'.  The namedtuple documentation uses both spellings.  The typing.NamedTuple class consistently uses the latter spelling.  The intent was the both would be spelled the same way.    >>> from typing import NamedTuple    >>> class Employee(NamedTuple):        name: str        id: int = 3    >>> Employee._field_defaults    {'id': 3}    >>> from collections import namedtuple    >>> Employee = namedtuple('Employee', ['name', 'id'], defaults=[3])    >>> Employee._fields_defaults    {'id': 3}Since 3.7 API is already released, it may be reasonable to provide both spellings for namedtuple().
msg338167 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-03-18 07:27
New changeset23581c018fceb607fe829a41c6fbe81b4d502cab by Raymond Hettinger in branch 'master':bpo-36321: Fix misspelled attribute in namedtuple() (GH-12375)https://github.com/python/cpython/commit/23581c018fceb607fe829a41c6fbe81b4d502cab
msg338169 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-03-18 07:48
New changesetbedfbc790e18f14cfdd59cf27d27bb86518dc3fc by Raymond Hettinger (Miss Islington (bot)) in branch '3.7':bpo-36321: Fix misspelled attribute in namedtuple() (GH-12375) (GH-12395)https://github.com/python/cpython/commit/bedfbc790e18f14cfdd59cf27d27bb86518dc3fc
msg355009 -(view)Author: Raymond Hettinger (rhettinger)*(Python committer)Date: 2019-10-20 17:19
New changeset58ccd201fa74287ca9293c03136fcf1e19800ef9 by Raymond Hettinger in branch 'master':bpo-36321: Fix misspelled attribute name in namedtuple() (GH-16858)https://github.com/python/cpython/commit/58ccd201fa74287ca9293c03136fcf1e19800ef9
History
DateUserActionArgs
2022-04-11 14:59:12adminsetgithub: 80502
2019-10-20 17:19:50rhettingersetmessages: +msg355009
2019-10-20 04:53:46rhettingersetpull_requests: +pull_request16405
2019-03-18 07:49:38rhettingersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-03-18 07:48:05rhettingersetmessages: +msg338169
2019-03-18 07:27:58miss-islingtonsetpull_requests: +pull_request12350
2019-03-18 07:27:42rhettingersetmessages: +msg338167
2019-03-16 20:43:20rhettingersetkeywords: +patch
stage: patch review
pull_requests: +pull_request12335
2019-03-16 20:21:03rhettingercreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp