Replies: 2 comments
-
Thanks for looking into this! I figured the descriptors were going to be tricky to type hint correctly. Would mind sharing your branch? I'd be interested in seeing the full MyPy output and maybe trying some experiments. Handling |
Beta Was this translation helpful? Give feedback.
-
See #11 for my research/attempt. |
Beta Was this translation helpful? Give feedback.
-
The following pattern has me stumped regarding typing hints and mypy.
Using the
dataclass.field()
example, I could create a factory function to createEntityIdDescriptor()
objects. But it doesn't scale well over all the descriptors. It also works by removing the type hint.I reviewed https://adamj.eu/tech/2021/10/18/python-type-hints-how-to-type-a-descriptor/ as an additional example, but it gets tangled up with the field types defined from the Mixin. Again the way I found to resolve this issue was removing typing hints.
Beta Was this translation helpful? Give feedback.
All reactions