
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2019-03-16 20:21 byrhettinger, last changed2022-04-11 14:59 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 12375 | merged | rhettinger,2019-03-16 20:43 | |
| PR 12395 | merged | miss-islington,2019-03-18 07:27 | |
| PR 16858 | merged | rhettinger,2019-10-20 04:53 | |
| Messages (4) | |||
|---|---|---|---|
| msg338096 -(view) | Author: Raymond Hettinger (rhettinger)*![]() | 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)*![]() | 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)*![]() | 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)*![]() | 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 | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:12 | admin | set | github: 80502 |
| 2019-10-20 17:19:50 | rhettinger | set | messages: +msg355009 |
| 2019-10-20 04:53:46 | rhettinger | set | pull_requests: +pull_request16405 |
| 2019-03-18 07:49:38 | rhettinger | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2019-03-18 07:48:05 | rhettinger | set | messages: +msg338169 |
| 2019-03-18 07:27:58 | miss-islington | set | pull_requests: +pull_request12350 |
| 2019-03-18 07:27:42 | rhettinger | set | messages: +msg338167 |
| 2019-03-16 20:43:20 | rhettinger | set | keywords: +patch stage: patch review pull_requests: +pull_request12335 |
| 2019-03-16 20:21:03 | rhettinger | create | |