News for hackers. Stuff that matters.
Re:The different uses of Python type hints by FreakLegion on Saturday April 15, 2023 @09:29PM (#35586415)
Dataclasses do care about type hints in some cases, for example when determining what counts as a field.

    @dataclass
    class A:
        a: int = 0
        b = 1

    >>> A(a=1, b=2)
    TypeError: __init__() got an unexpected keyword argument 'b'

There are no comments on this comment yet.