| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
(cherry picked from commit e7adf2ba41832404100313f9ac9d9f7fabedc1fd)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 4e81296b1874829912c687eba4d39361ab51e145)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 2a7bacbd913cf2bf568b3c0f85a758946d3cf4e9)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
* Add a test for frozen with unhashable field value.
* Improve a comment.
(cherry picked from commit 74940913d26d9f94b8572eca794369841fa6d9b6)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 5a7092de1226a95a50f0f384eea8ddb288959249)
Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-6305)
(cherry picked from commit 521995205a2cb6b504fe0e39af22a81f785350a3)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
argument. (GH-6260)
This is part of PEP 487 and the descriptor protocol.
(cherry picked from commit de7a2f04d6b9427d568fcb43b6f512f9b4c4bd84)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
|
| |
Also, re-enable a test for ClassVars with default_factory.
(cherry picked from commit 2b75fc2bc97702224de0fae8ab026ec0cd0706ab)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 51c9ab42ab84643081d75c83a586afa45d910383)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit c42e7aa67ce72a6c4c6cdfe3b0929ca07556d444)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
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.
(cherry picked from commit 56970b8ce9d23269d20a76f13c80e670c856ba7f)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
- Add missing 'Field' to __all__.
- Improve tests to catch this.
(cherry picked from commit 8e4560a9da6a02aa157dd7df8bd0be0d258c0a73)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
default_factory (GH-6170) (GH-6171)
Fix the way that new annotations in a class are detected.
(cherry picked from commit 8f6eccdc64cab735c47620fea948e64b19f83684)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
(GH-6152) (GH-6153)
If the class has a member that's a MemberDescriptorType, it's not a default value, it's from that member being in __slots__.
(cherry picked from commit 7389fd935c95b4b6f094312294e703ee0de18719)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
| |
derived classes (GH-6147) (GH-6148)
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.
(cherry picked from commit f199bc655eb50c28e94010714629b376bbbd077b)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
classes and vice-versa, (GH-5919) (GH-5920)
This restriction will be relaxed at a future date.
(cherry picked from commit 2fa6b9eae07e2385e2acbf2e40093a21fb3a10c4)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
unsafe_hash. (GH-5891) (GH-5902)
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.
(cherry picked from commit dbf9cff48a4ad0fd58e1c623ce1f36c3dd3d5f38)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 973cae07d6ce7f5a93bd9cd3bcb724a96cfe14e9)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
| |
|
|
|
|
|
| |
in anticipation of changing how non-default hashing is handled. (GH-5834) (GH-5889)
(cherry picked from commit 718070db26b35da4aedc03088c58558a833ccf6e)
Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
|
| | |
|
| |
|
| |
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.
|
| |
|
|
| |
dataclass(). (gh-5117)
|
| |
|
|
| |
(gh-5115)
|
| |
|
|
| |
dataclass or an instance of one. (#5113)
|
| | |
|
| |
|
|
| |
(#4903)
|
| |
|
|
|
|
|
|
| |
* Fix multiple typos in code comments
* Add spacing in comments (test_logging.py, test_math.py)
* Fix spaces at the beginning of comments in test_logging.py
|
| | |
|
| |
|