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
Although I find it questionable, whether we even want to reveal the full implementation based on list, or maybe actually just go with something like Mapping[str, Any] (Actually mapping isn't entirely correct either because it implies Collection[str]. So more like a custom class that does not inherit list and has only __getitem__(str), __contains__(str) and keys(str).
## System information
- `django-stubs` version: [33d4dc7](https://github.com/typeddjango/django-stubs/commit/33d4dc7dae8fb825d3804887a14d7594dc655abf)
The text was updated successfully, but these errors were encountered:
Looks like it has been (mostly) fixed by #1100 . The interface is a bit simpler than my suggestion. Not sure if that has any practical significance though.
Unfortunately I can't fully test with our complex codebase because of another blocker.
Bug report
The type stub for
django.test.ContextList
is incomplete.What's wrong
https://github.com/typeddjango/django-stubs/blob/master/django-stubs/test/utils.pyi#L44-L46
Is missing
__getitem__(str)
and__contains__(str)
. Technically,get(int)
is also missing.I also think that the type
default: Optional[str]
forget
is wrong and should be eitherAny
orOptional[Any]
.How is that should be
I suppose a full interface could look something like that:
https://mypy-play.net/?mypy=latest&python=3.10&gist=f736dc3a1c40b8ddfa2e15900c0aac53
Although I find it questionable, whether we even want to reveal the full implementation based on
list
, or maybe actually just go with something likeMapping[str, Any]
(Actually mapping isn't entirely correct either because it impliesCollection[str]
. So more like a custom class that does not inheritlist
and has only__getitem__(str)
,__contains__(str)
andkeys(str)
.The text was updated successfully, but these errors were encountered: