
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2017-12-11 19:47 byeric.smith, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 4982 | closed | gregory.p.smith,2017-12-22 22:35 | |
| PR 5115 | merged | eric.smith,2018-01-06 20:17 | |
| Messages (3) | |||
|---|---|---|---|
| msg308071 -(view) | Author: Eric V. Smith (eric.smith)*![]() | Date: 2017-12-11 19:47 | |
Make the typing information optional.From Raymond Hettinger:The make_dataclass() factory function in the dataclasses module currently requires type declarations. It would be nice if the type declarations were optional.With typing (currently works): Point = NamedTuple('Point', [('x', float), ('y', float), ('z', float)]) Point = make_dataclass('Point', [('x', float), ('y', float), ('z', float)])Without typing (only the first currently works): Point = namedtuple('Point', ['x', 'y', 'z']) # underlying store is a tuple Point = make_dataclass('Point', ['x', 'y', 'z']) # underlying store is an instance dict | |||
| msg308583 -(view) | Author: Eric V. Smith (eric.smith)*![]() | Date: 2017-12-18 20:32 | |
I'm going to use "typing.Any" (as a string) if the type information is omitted in the call to make_dataclass(). That way I don't need to import typing. | |||
| msg309580 -(view) | Author: Eric V. Smith (eric.smith)*![]() | Date: 2018-01-06 21:14 | |
New changeseted7d429ebb591f65cef558760fb4ebdc4fc8f8b0 by Eric V. Smith in branch 'master':bpo-32278: Allow dataclasses.make_dataclass() to omit type information. (gh-5115)https://github.com/python/cpython/commit/ed7d429ebb591f65cef558760fb4ebdc4fc8f8b0 | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:55 | admin | set | github: 76459 |
| 2018-01-06 21:14:50 | eric.smith | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2018-01-06 21:14:05 | eric.smith | set | messages: +msg309580 |
| 2018-01-06 20:17:24 | eric.smith | set | pull_requests: +pull_request4981 |
| 2017-12-22 22:38:50 | gregory.p.smith | set | nosy: +gregory.p.smith |
| 2017-12-22 22:35:45 | gregory.p.smith | set | keywords: +patch stage: patch review pull_requests: +pull_request4871 |
| 2017-12-18 20:32:16 | eric.smith | set | messages: +msg308583 |
| 2017-12-11 19:47:31 | eric.smith | create | |