CharField missing `__init__` declaration
https://github.com/microsoft/pylance-release/issues/3401
Pretty sure we use __new__ instead so that we can make both pyright and mypy happy:
https://cs.github.com/sbdchd/django-types/blob/8b5f4bcbfa3b3ee7663f2b502490f1d4a7021d98/django-stubs/db/models/fields/init.pyi?q=CharField#L687
might be worth revisiting if that's still necessary -- I can't remember which type checker preferred new to init
pyright seems to prefer init.. users not getting correct signatures anymore
I'll have to revert pylance back to the old stubs https://github.com/typeddjango/django-stubs for now
Yeah, we could probably change the types to use __init__ instead of __new__
@bschnurr I've refactored the type definitions to use __init__ in #139, but Pylance is having issues with understanding foreign keys. Mypy seems to work fine though and we do have better autocomplete.
reveal_type(comment.nullable_user_type)
mypy: Revealed type is "Union[tests.trout.models.User, None]"
Pylance: Type of "comment.nullable_user_type" is "_M@ForeignKey | None"
Pylance/pyright have been updated to look at __new__