sbdchd / django-types

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

Incorrect type annotation for instance field `expression` in `OrderBy` #200

Open dhshah opened 11 months ago

dhshah commented 11 months ago

https://github.com/sbdchd/django-types/blob/06da6da7fce4d8bc944e74b403e470ee1eacb57e/django-stubs/db/models/expressions.pyi#L160C32-L160C32

The type annotation should be Expression | F | Subquery instead of Expression (Source)

The related code from django's constructor is self.expression = expression (source)

dhshah commented 11 months ago

https://github.com/typeddjango/django-stubs/blob/a249686896f9e8d4ae31956bf9d3d9d4d13185db/django-stubs/db/models/expressions.pyi#L254C5-L254C42

Here is the LOC from the original fork.