Forward references in methods #1180
-
Hi everyone, How should a type checker resolve the return type of
? According to PEP 484
which, I think, implies that the reference A few more motivating examples
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
That's correct. Mypy and pyright both interpret it this way. However, I'd recommend against using conflicting names like this. It harms readability, and you will inevitably see inconsistencies across tools. |
Beta Was this translation helpful? Give feedback.
That's correct. Mypy and pyright both interpret it this way. However, I'd recommend against using conflicting names like this. It harms readability, and you will inevitably see inconsistencies across tools.