You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Has anyone else seen this? I've been unable to create an isolated reproducer and I'm not familiar enough with mypy to understand what's really going on here. Would love to get this fixed though, as it's causing us use a lot of # type: ignore comments! I'll keep digging, but would love some help to get this fixed.
How is that should be
The type signature should be kept as def (self: _QS, alias: Optional[str]) -> _QS.
Bug report
What's wrong
For some custom managers in our codebase we get an incorrect typing error for calls to
.using()
:Stepping through the plugin this appears to stem from this call to
helpers.copy_method_to_another_class
. That callsbind_or_anaylyze_type
for each argument, which again ends up callingapi.lookup_fully_qualified_or_none("django.db.models.query.Optional")
. This is where the_SpecialCase
comes into play, because the type of thealias
parameter is an instance ofUnboundType
up to this point.Has anyone else seen this? I've been unable to create an isolated reproducer and I'm not familiar enough with mypy to understand what's really going on here. Would love to get this fixed though, as it's causing us use a lot of
# type: ignore
comments! I'll keep digging, but would love some help to get this fixed.How is that should be
The type signature should be kept as
def (self: _QS, alias: Optional[str]) -> _QS
.System information
python
version: 3.9.9 an 3.10.2django
version: 3.2.13mypy
version: 0.950django-stubs
version: latest master (e221f0e0533c98417ed726cba764b5f6282442f8
)django-stubs-ext
version: latest master (e221f0e0533c98417ed726cba764b5f6282442f8
)The text was updated successfully, but these errors were encountered: