Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix dataclassses spelling (GH-28837) | Landon Yarrington | 2021-10-09 | 1 | -1/+1 |
| | |||||
* | Fix typos in multiple files (GH-26689) | Binbin | 2021-06-13 | 1 | -1/+1 |
| | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> | ||||
* | Fix dataclass comment typo _eq__ -> __eq__ (GH-26433) | Sean Grady | 2021-05-28 | 1 | -1/+1 |
| | |||||
* | bpo-44015: dataclasses should allow KW_ONLY to be specified only once per ↵ | Eric V. Smith | 2021-05-03 | 1 | -0/+5 |
| | | | | | class (GH-25841) bpo-44015: Raise a TypeError if KW_ONLY is specified more than once. | ||||
* | If using a frozen class with slots, add __getstate__ and __setstate__ to set ↵ | Eric V. Smith | 2021-05-01 | 1 | -2/+21 |
| | | | | the instance values. (GH-25786) | ||||
* | bpo-42269: Add slots parameter to dataclass decorator (GH-24171) | Yurii Karabas | 2021-05-01 | 1 | -6/+39 |
| | | | Add slots parameter to dataclass decorator and make_dataclass function. | ||||
* | Add keyword-only fields to dataclasses. (GH=25608) | Eric V. Smith | 2021-04-26 | 1 | -32/+101 |
| | |||||
* | bpo-38605: Revert making 'from __future__ import annotations' the default ↵ | Pablo Galindo | 2021-04-21 | 1 | -10/+3 |
| | | | | | | (GH-25490) This reverts commits 044a1048ca93d466965afc027b91a5a9eb9ce23c and 1be456ae9d53bb1cba2b24fc86175c282d1c2169, adapting the code to changes that happened after it. | ||||
* | Fix typo in a dataclasses comment. (GH-25454) | Eric V. Smith | 2021-04-17 | 1 | -1/+1 |
| | |||||
* | Remove an unnecessary copy of the 'namespace' parameter to make_dataclass(). ↵ | Eric V. Smith | 2021-04-13 | 1 | -8/+13 |
| | | | | (GH-25372) | ||||
* | bpo-43764: Add match_args=False parameter to dataclass decorator and to ↵ | Eric V. Smith | 2021-04-11 | 1 | -14/+24 |
| | | | | | make_dataclasses function. (GH-25337) Add match_args=False parameter to dataclass decorator and to make_dataclass function. | ||||
* | bpo-43764: Fix `__match_args__` generation logic for dataclasses (GH-25284) | Brandt Bucher | 2021-04-08 | 1 | -1/+1 |
| | |||||
* | bpo-43176: Fix processing of empty dataclasses (GH-24484) | Iurii Kemaev | 2021-04-06 | 1 | -1/+1 |
| | | | | | When a dataclass inherits from an empty base, all immutability checks are omitted. This PR fixes this and adds tests for it. Automerge-Triggered-By: GH:ericvsmith | ||||
* | bpo-36470: Allow dataclasses.replace() to handle InitVars with default ↵ | Zackery Spytz | 2021-04-05 | 1 | -1/+1 |
| | | | | | | | values (GH-20867) Co-Authored-By: Claudiu Popa <pcmanticore@gmail.com> Automerge-Triggered-By: GH:ericvsmith | ||||
* | bpo-42128: Structural Pattern Matching (PEP 634) (GH-22917) | Brandt Bucher | 2021-02-26 | 1 | -0/+12 |
| | | | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Talin <viridia@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com> | ||||
* | bpo-41747: Ensure all dataclass methods uses their parents' qualname (GH-22155) | Batuhan Taskaya | 2020-10-21 | 1 | -2/+9 |
| | | | | | * bpo-41747: Ensure all dataclass methods uses their parents' qualname Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> | ||||
* | bpo-38605: Make 'from __future__ import annotations' the default (GH-20434) | Batuhan Taskaya | 2020-10-06 | 1 | -3/+10 |
| | | | | | The hard part was making all the tests pass; there are some subtle issues here, because apparently the future import wasn't tested very thoroughly in previous Python versions. For example, `inspect.signature()` returned type objects normally (except for forward references), but strings with the future import. We changed it to try and return type objects by calling `typing.get_type_hints()`, but fall back on returning strings if that function fails (which it may do if there are future references in the annotations that require passing in a specific namespace to resolve). | ||||
* | bpo-41905: Add abc.update_abstractmethods() (GH-22485) | Ben Avrahami | 2020-10-06 | 1 | -0/+3 |
| | | | | This function recomputes `cls.__abstractmethods__`. Also update `@dataclass` to use it. | ||||
* | Fix typo in dataclasses module (GH-21109) | Jürgen Gmach | 2020-06-24 | 1 | -1/+1 |
| | | | Automerge-Triggered-By: @matrixise | ||||
* | bpo-39481: PEP 585 for dataclasses, mailbox, contextvars (GH-19425) | Ethan Smith | 2020-04-14 | 1 | -0/+3 |
| | |||||
* | bpo-34776: Fix dataclasses to support __future__ "annotations" mode (#9518) | Yury Selivanov | 2019-12-09 | 1 | -34/+53 |
| | |||||
* | bpo-38431: Fix __repr__ method of InitVar to work with typing objects. ↵ | Samuel Colvin | 2019-10-13 | 1 | -1/+6 |
| | | | | | | (GH-16702) | ||||
* | bpo-38209: Simplify dataclasses.InitVar by using __class_getitem__(). (GH-16255) | Serhiy Storchaka | 2019-09-22 | 1 | -5/+4 |
| | |||||
* | bpo-37868: Improve is_dataclass for instances. (GH-15325) | Eric V. Smith | 2019-08-20 | 1 | -2/+3 |
| | |||||
* | Fix typos in docs, comments and test assert messages (#14872) | Min ho Kim | 2019-07-21 | 1 | -1/+1 |
| | |||||
* | bpo-37163: Make the obj argument of dataclasses.replace() a positional-only. ↵ | Serhiy Storchaka | 2019-06-26 | 1 | -1/+1 |
| | | | | (GH-14390) | ||||
* | bpo-33569 Preserve type information with dataclasses.InitVar (GH-8927) | Augusto Hack | 2019-06-03 | 1 | -3/+10 |
| | |||||
* | bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700) | Serhiy Storchaka | 2019-06-01 | 1 | -6/+3 |
| | |||||
* | bpo-35960: Fix dataclasses.field throwing away empty metadata. (GH-11815) | Christopher Hunt | 2019-02-12 | 1 | -1/+1 |
| | |||||
* | bpo-33947: dataclasses no longer can raise RecursionError in repr (GF9916) | Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) | 2018-10-19 | 1 | -6/+31 |
| | | | The reprlib code was copied here instead of importing reprlib. I'm not sure if we really need to avoid the import, but since I expect dataclasses to be more common that reprlib, it seems wise. Plus, the code is small. | ||||
* | 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. |