Last active
March 8, 2020 06:03
-
-
Save prostomarkeloff/5aec6cd94750cc189f635b840778fca1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Token = NewType("Token", str) | |
class ABCToken: | |
typeof: ClassVar[TokenType] | |
get_token_type: ClassVar[GetTokenType] | |
get_token: Union[GetTokenSync, GetTokenAsync] | |
class ABCSyncToken(ABCToken): | |
get_token_type = GetTokenType.SYNC | |
get_token: GetTokenSync | |
class ABCBotSyncToken(ABCBotToken, ABCSyncToken): | |
pass | |
# token.py:78: error: Signature of "get_token" incompatible with supertype "ABCToken" | |
class BotSyncSingleToken(ABCBotSyncToken): | |
def __init__(self, token: Token): | |
self._token: Token = token | |
def get_token(self, *args, **kwargs) -> Token: | |
return self._token |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment