Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue32278

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:Allow dataclasses.make_dataclass() to omit type information
Type:behaviorStage:resolved
Components:Library (Lib)Versions:Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: eric.smithNosy List: eric.smith, gregory.p.smith, levkivskyi, rhettinger
Priority:normalKeywords:patch

Created on2017-12-11 19:47 byeric.smith, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 4982closedgregory.p.smith,2017-12-22 22:35
PR 5115mergederic.smith,2018-01-06 20:17
Messages (3)
msg308071 -(view)Author: Eric V. Smith (eric.smith)*(Python committer)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)*(Python committer)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)*(Python committer)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
DateUserActionArgs
2022-04-11 14:58:55adminsetgithub: 76459
2018-01-06 21:14:50eric.smithsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-01-06 21:14:05eric.smithsetmessages: +msg309580
2018-01-06 20:17:24eric.smithsetpull_requests: +pull_request4981
2017-12-22 22:38:50gregory.p.smithsetnosy: +gregory.p.smith
2017-12-22 22:35:45gregory.p.smithsetkeywords: +patch
stage: patch review
pull_requests: +pull_request4871
2017-12-18 20:32:16eric.smithsetmessages: +msg308583
2017-12-11 19:47:31eric.smithcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp