| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
argument. (GH-6260)
This is part of PEP 487 and the descriptor protocol.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
| |
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 missing 'Field' to __all__.
- Improve tests to catch this.
|
|
|
|
|
| |
default_factory (GH-6170)
Fix the way that new annotations in a class are detected.
|
|
|
|
|
| |
(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__.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
classes and vice-versa, (GH-5919)
This restriction will be relaxed at a future date.
|
|
|
|
|
| |
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.
|
|
|
| |
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.
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
dataclass(). (gh-5117)
|
|
|
|
| |
(gh-5115)
|
|
|
|
| |
dataclass or an instance of one. (#5113)
|
| |
|
|
|