venv/lib/python3.12/site-packages/web/repositories/token.py: note: In function "create_token":
venv/lib/python3.12/site-packages/web/repositories/token.py:13:16: error: "Token" has no attribute "access_token"
[attr-defined]
return str(refresh.access_token)
^~~~~~~~~~~~~~~~~~~~
Token.for_user class method returns cls() which allows subclasses returns it's own instances. But annotations says it would always be a Token.
Let say we have code block like this:
That would produce error in mypy:
Token.for_user
class method returnscls()
which allows subclasses returns it's own instances. But annotations says it would always be a Token.Maybe
typing.Self
would work?