Replies: 3 comments
-
Moving this to a discussion since it's a question about how to use |
Beta Was this translation helpful? Give feedback.
-
Please refer to the specification in PEP 681. The In your second example, you've specified that the default value for |
Beta Was this translation helpful? Give feedback.
-
The PEP says:
Which is a bit unclear, but to me it does sound like indirectly using the metaclass is fine. Plus, isn't that just... y'know, OOP? If the parent class is a dataclass transform, then so is the child class.
It is. I guess that one isn't pyright's fault; I got misled by I've also managed to reproduce one of the other bugs I mentioned, but it appears to have been fixed already. (VScode's pyright version seems to be 2 months out of date...) |
Beta Was this translation helpful? Give feedback.
-
Since apparently nothing I report is considered a bug, I won't waste my time going into too much detail. But
@dataclass_transform()
is extremely poorly supported, and the tiniest change can lead to completely different results. Some examples:Among other problems that I can't reproduce with a short snippet.
Beta Was this translation helpful? Give feedback.
All reactions