|
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 |
Answered by
Gobot1234
Nov 11, 2023
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 |
1 reply
Answer selected by
henribru
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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