summaryrefslogtreecommitdiffstats
path: root/Lib/dataclasses.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Add 'Field' to dataclasses.__all__. (GH-6182)Eric V. Smith2018-03-211-1/+2
| | | | - Add missing 'Field' to __all__. - Improve tests to catch this.
* bpo-32896: Fix error when subclassing a dataclass with a field that uses a ↵Eric V. Smith2018-03-211-11/+12
| | | | | default_factory (GH-6170) Fix the way that new annotations in a class are detected.
* bpo-33100: Dataclasses now handles __slots__ and default values correctly. ↵Eric V. Smith2018-03-201-0/+3
| | | | | (GH-6152) If the class has a member that's a MemberDescriptorType, it's not a default value, it's from that member being in __slots__.
* bpo-32953: Dataclasses: frozen should not be inherited for non-dataclass ↵Eric V. Smith2018-03-191-31/+89
| | | | | | | derived classes (#6147) If a non-dataclass derives from a frozen dataclass, allow attributes to be set. Require either all of the dataclasses in a class hierarchy to be frozen, or all non-frozen. Store `@dataclass` parameters on the class object under `__dataclass_params__`. This is needed to detect frozen base classes.
* Fixed incorrect default value for dataclass unsafe_hash. (GH-5949)Eric V. Smith2018-03-011-2/+2
|
* bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen ↵Eric V. Smith2018-02-271-6/+13
| | | | | classes and vice-versa, (GH-5919) This restriction will be relaxed at a future date.
* bpo-32929: Dataclasses: Change the tri-state hash parameter to the boolean ↵Eric V. Smith2018-02-261-79/+105
| | | | | unsafe_hash. (#5891) unsafe_hash=False is now the default. It is the same behavior as the old hash=None parameter. unsafe_hash=True will try to add __hash__. If it already exists, TypeError is raised.
* bpo-32513: Make it easier to override dunders in dataclasses. (GH-5366)Eric V. Smith2018-01-281-82/+224
| | | Class authors no longer need to specify repr=False if they want to provide a custom __repr__ for dataclasses. The same thing applies for the other dunder methods that the dataclass decorator adds. If dataclass finds that a dunder methods is defined in the class, it will not overwrite it.
* bpo-32226: PEP 560: improve typing module (#4906)Ivan Levkivskyi2018-01-201-1/+2
| | | | This PR re-designs the internal typing API using the new PEP 560 features. However, there are only few minor changes in the public API.
* Fix obvious typos in docstrings (#5151)Raymond Hettinger2018-01-111-6/+7
|
* bpo-32506: Change dataclasses from OrderedDict to plain dict. (gh-5131)Eric V. Smith2018-01-071-8/+8
|
* Fix dataclasses docstring typo. (gh-5118)Eric V. Smith2018-01-071-2/+2
|
* bpo-32279: Add additional params to make_dataclass(), pass through to ↵Eric V. Smith2018-01-061-3/+7
| | | | dataclass(). (gh-5117)
* bpo-32278: Allow dataclasses.make_dataclass() to omit type information. ↵Eric V. Smith2018-01-061-6/+14
| | | | (gh-5115)
* bpo-32499: Add dataclasses.is_dataclass(obj), which returns True if obj is a ↵Eric V. Smith2018-01-061-6/+13
| | | | dataclass or an instance of one. (#5113)
* bpo-32427: Expose dataclasses.MISSING object. (#5045)Eric V. Smith2017-12-291-20/+21
|
* bpo-32214: Implement PEP 557: Data Classes (#4704)Eric V. Smith2017-12-041-0/+776