sbdchd / django-types

:doughnut: Type stubs for Django
MIT License
187 stars 62 forks source link

Django-ninjas urls have the wrong shape for django.urls.path #173

Closed bobthemighty closed 5 months ago

bobthemighty commented 1 year ago

The signature of path in the stubs expects a view parameter of type List[Union[URLResolver, str]]

But Django-ninjas gives

Tuple[List[Union[URLResolver, URLPattern]], str, str]:

I'm happy to open a PR to fix the discrepancy, but I'm frankly lost trying to understand what the type here should be.

sbdchd commented 1 year ago

Hmm I'm not sure what the usage is supposed to look like but I imagine Django-ninja's is probably correct

There are some existing overloads:

https://github.com/sbdchd/django-types/blob/d97beb9a422a304581fcb09619f12a66c857cb47/django-stubs/urls/conf.pyi#L40

bobthemighty commented 1 year ago

Do you want me to just dump in another overload to satisfy this case? I could spend some time trying to work out what the heck that function actually does but I'm not sure I have the context to do a good job.

sbdchd commented 1 year ago

I think another overload is a good fix!