Open chdsbd opened 1 year ago
oh pyright is angry in CI, maybe it needs an update?
any eta?
@bschnurr We can make this change, but it breaks foreign keys for Pylance. Mypy still works though: https://github.com/sbdchd/django-types/issues/136#issuecomment-1270744593
@chdsbd found an alternative fix..
just remove def __init__(self, *args: Any, **kwargs: Any) -> None: ...
from class Field and keep all the __new__
func definitions
https://github.com/sbdchd/django-types/blob/842bcd6f6efac091b5ebd0565203cc367aa54140/django-stubs/db/models/fields/__init__.pyi#L124
then the previous __new__
function signatures will be picked up
__new__
and __init__
signatures aren't matching.
pyright does have a check for this. reportInconsistentConstructor
now i see a proper signature
this is a pylance bug. working on a fix
I believe we previously used new to support Pylance. Now Pylance doesn't support new so we need to use init.
Mypy works either way, but this allows us to get Pylance working properly with auto complete.
related: #136