Showing posts with the label python-dataclasses

[FIXED] MyPy fails dataclass argument with optional list of objects type

Issue I'm having trouble getting MyPy to pass my script which contains a dataclass Bar with a…

[FIXED] How can i type hint the init params are the same as fields in a dataclass?

Issue Let us say I have a custom use case, and I need to dynamically create or define the __init__ …

[FIXED] Building and using new data types in Python

Issue How do you build custom data types in Python (similar to how you define interface in TypeScr…

[FIXED] Confusing behavior when using TypeVar with dataclass

Issue If I define a type like the following: StringType = TypeVar('StringType', str, None)…

[FIXED] Is there an alias or name parameter for dataclass arguments?

Issue I have a class that accepts a lot of params, and in init method I'm loading them in diffe…

[FIXED] Validating detailed types in python dataclasses

Issue Python 3.7 was released a while ago, and I wanted to test some of the fancy new dataclass +ty…

[FIXED] Making classfactory that derive from dataclass objects informed by types in python

Issue When using dataclasses.dataclass the type information informs how parameters are parsed. I w…

[FIXED] How to avoid unexpected argument warning using data classes

Issue I have the following simple code. @dataclass(frozen=True) class Test: a: bool = True …