Token
subclass' for_user
method is typed to return a Token
#794
Labels
Token
subclass' for_user
method is typed to return a Token
#794
The example from the doc itself is a good minimal reproduction of this issue:
https://django-rest-framework-simplejwt.readthedocs.io/en/latest/creating_tokens_manually.html
RefreshToken.for_user(user)
's return type, as seen by type-checkers (mypy/pyright) isToken
instead ofRefreshToken
.This is caused by
BlacklistMixin.for_user
being typed to return aToken
, where I believe it should probably returnSelf
(from typing_extensions import Self
)CC @theo-auffeuvre & @NicolasDontigny for visibility
The text was updated successfully, but these errors were encountered: