-
-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: tuple index out of range #1785
Comments
Do you have example code that reproduces this? Is this a regression in 4.2.5 or does this affect earlier versions as well? |
Looks like it might be related to #1666 from django-stubs 4.2.4. |
Ping @moranabadie. |
A first step here might be to only resolve the crash. i.e. gracefully handle empty Might be as simple as a typo that triggers the crash. |
Sorry for the late comment here -- I don't have a minimal repro, but the code is roughly: # related.py
class RelatedQuerySet(QuerySet["Related"]):
def foo() -> None:
...
class RelatedManager(Manager["Related"]):
...
RelatedModelManager = RelatedManager.from_queryset(
RelatedQuerySet
)
class Related(Model):
objects = RelatedModelManager()
my_model = ForeignKey("MyModel", related_name="related_objects") # my_model.py
class MyModel(Model):
@property
def related_foo() -> None:
return self.related_objects.foo(). # error happens here |
Bug report
System information
python:3.11
python
version: 3.11django
version: 4.2mypy
version: 1.6.1django-stubs
version: 4.2.5The text was updated successfully, but these errors were encountered: