[issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type

2020-11-19 Thread ARF1
ARF1 added the comment: One problem I have with the current behaviour is that users of library code need to know the exact namespace in which a library has defined a dataclass. An example is if a library writer had to deconflict the name of a type he used in a user-facing dataclass. Below

[issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type

2020-11-19 Thread ARF1
ARF1 added the comment: Another counter-intuitive behaviour is the different behaviour of dataclasses depending on whether they were defined with the decorator or the make_dataclass factory method: from __future__ import annotations import dataclasses mytype = int @dataclasses.dataclass