-
-
Notifications
You must be signed in to change notification settings - Fork 505
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
What's wrong
My code looks like this:
from django.utils.timesince import timesince
timesince(d, now, depth=1)
When I run mypy, I see the following error:
error: Unexpected keyword argument "depth" for "timesince"
env/lib/python3.10/site-packages/django-stubs/utils/timesince.pyi:7: note: "timesince" defined here
It looks like the depth
argument was added at django 3.2: django/django@8fa9a6d
The django-stubs definition doesn’t include the depth
argument:
django-stubs/django-stubs/utils/timesince.pyi
Lines 7 to 9 in 4e3f9d6
def timesince( | |
d: date, now: Optional[date] = ..., reversed: bool = ..., time_strings: Optional[Dict[str, str]] = ... | |
) -> str: ... |
How it should be
I guess the timesince definition should look like this:
def timesince(
d: date, now: Optional[date] = ..., reversed: bool = ..., time_strings: Optional[Dict[str, str]] = ..., depth: Optional[int] = ...
) -> str: ...
The same issue applies to utils.timesince.timeuntil.
System information
python
version: 3.10django
version: 3.2mypy
version: 0.941django-stubs
version: 1.10.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working