Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | bpo-34363: dataclasses.asdict() and .astuple() now handle fields which are ↵ | Eric V. Smith | 2018-09-14 | 1 | -2/+38 |
| | | | | namedtuples. (GH-9151) | ||||
* | bpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452) | Vadim Pushtaev | 2018-08-12 | 1 | -1/+7 |
| | |||||
* | Fix typo in dataclasses documentation (GH-8102) | Artjom | 2018-07-05 | 1 | -1/+1 |
| | |||||
* | bpo-33805: Improve error message of dataclasses.replace() (GH-7580) | Dong-hee Na | 2018-06-23 | 1 | -0/+3 |
| | |||||
* | bpo-33796: Ignore ClassVar for dataclasses.replace(). (GH-7488) | Eric V. Smith | 2018-06-07 | 1 | -1/+5 |
| | |||||
* | bpo-33536: Validate make_dataclass() field names. (GH-6906) | Eric V. Smith | 2018-05-16 | 1 | -0/+15 |
| | |||||
* | bpo-33534: Remove unneeded test. (GH-6897) | Eric V. Smith | 2018-05-16 | 1 | -6/+5 |
| | | | This condition as already tested before this code is called. | ||||
* | Reflow dataclasses comments (GH-6893) | Eric V. Smith | 2018-05-16 | 1 | -170/+176 |
| | | | To be more consistent with other code (and so people stop hassling me!), reflow the dataclasses comments to not use a single space indentation when continuing a paragraph of text. | ||||
* | bpo-33453: Handle string type annotations in dataclasses. (GH-6768) | Eric V. Smith | 2018-05-16 | 1 | -18/+116 |
| | |||||
* | bpo-33517: dataclasses: Add the field type to Field repr (GH-6858) | Eric V. Smith | 2018-05-15 | 1 | -4/+10 |
| | |||||
* | bpo-33502: dataclass._Dataclassparams repr: use repr of each member. (GH-6812) | Eric V. Smith | 2018-05-14 | 1 | -6/+6 |
| | |||||
* | bpo-33494: Change dataclasses.Fields repr to use the repr of each of its ↵ | Eric V. Smith | 2018-05-14 | 1 | -8/+8 |
| | | | | members (GH-6798) | ||||
* | Allow dynamic creation of generic dataclasses (GH-6319) | Ivan Levkivskyi | 2018-03-31 | 1 | -1/+3 |
| | |||||
* | bpo-33175: dataclasses should look up __set_name__ on class, not instance ↵ | Eric V. Smith | 2018-03-29 | 1 | -2/+2 |
| | | | | (GH-6305) | ||||
* | bpo-33141: Have dataclasses.Field pass through __set_name__ to any default ↵ | Eric V. Smith | 2018-03-26 | 1 | -0/+14 |
| | | | | | argument. (GH-6260) This is part of PEP 487 and the descriptor protocol. | ||||
* | bpo-33134: dataclasses: use function dispatch table for hash, instead of a ↵ | Eric V. Smith | 2018-03-25 | 1 | -40/+36 |
| | | | | | | | string lookup which then is tested with if tests. (GH-6222) * Change _hash_action to be a function table lookup, instead of a list of strings which is then tested with if statements. | ||||
* | Trivial dataclass cleanups: (GH-6218) | Eric V. Smith | 2018-03-24 | 1 | -23/+26 |
| | | | | | | | | | | - When adding a single element to a list, use .append() instead of += and creating a new list. - For consistency, import the copy module, instead of just deepcopy. This leaves only a module at the class level, instead of a function. - Improve some comments. - Improve some whitespace. - Use tuples instead of lists. - Simplify a test. | ||||
* | bpo-32505: dataclasses: raise TypeError if a member variable is of type ↵ | Eric V. Smith | 2018-03-22 | 1 | -17/+21 |
| | | | | | Field, but doesn't have a type annotation. (GH-6192) If a dataclass has a member variable that's of type Field, but it doesn't have a type annotation, raise TypeError. | ||||
* | Add 'Field' to dataclasses.__all__. (GH-6182) | Eric V. Smith | 2018-03-21 | 1 | -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. Smith | 2018-03-21 | 1 | -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. Smith | 2018-03-20 | 1 | -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. Smith | 2018-03-19 | 1 | -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. Smith | 2018-03-01 | 1 | -2/+2 |
| | |||||
* | bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen ↵ | Eric V. Smith | 2018-02-27 | 1 | -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. Smith | 2018-02-26 | 1 | -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. Smith | 2018-01-28 | 1 | -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 Levkivskyi | 2018-01-20 | 1 | -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 Hettinger | 2018-01-11 | 1 | -6/+7 |
| | |||||
* | bpo-32506: Change dataclasses from OrderedDict to plain dict. (gh-5131) | Eric V. Smith | 2018-01-07 | 1 | -8/+8 |
| | |||||
* | Fix dataclasses docstring typo. (gh-5118) | Eric V. Smith | 2018-01-07 | 1 | -2/+2 |
| | |||||
* | bpo-32279: Add additional params to make_dataclass(), pass through to ↵ | Eric V. Smith | 2018-01-06 | 1 | -3/+7 |
| | | | | dataclass(). (gh-5117) | ||||
* | bpo-32278: Allow dataclasses.make_dataclass() to omit type information. ↵ | Eric V. Smith | 2018-01-06 | 1 | -6/+14 |
| | | | | (gh-5115) | ||||
* | bpo-32499: Add dataclasses.is_dataclass(obj), which returns True if obj is a ↵ | Eric V. Smith | 2018-01-06 | 1 | -6/+13 |
| | | | | dataclass or an instance of one. (#5113) | ||||
* | bpo-32427: Expose dataclasses.MISSING object. (#5045) | Eric V. Smith | 2017-12-29 | 1 | -20/+21 |
| | |||||
* | bpo-32214: Implement PEP 557: Data Classes (#4704) | Eric V. Smith | 2017-12-04 | 1 | -0/+776 |