-
In a meta class, is there a way to refer to an instance of the class that uses the metaclass? In a regular classmethod you can use https://mypy-play.net/?mypy=latest&python=3.11&gist=ac7550a5b678afea19f55d2d92e6eec8 (Mypy actually errors on the usage of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is something that I considered when writing PEP 673 but the idea never went anywhere. However in your case you can probably just use a type var bound to Message and take that and return it from .pb |
Beta Was this translation helpful? Give feedback.
This is something that I considered when writing PEP 673 but the idea never went anywhere. However in your case you can probably just use a type var bound to Message and take that and return it from .pb