Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DecimalField inferred as Any #71

Closed
baojd42 opened this issue Aug 12, 2024 · 2 comments
Closed

DecimalField inferred as Any #71

baojd42 opened this issue Aug 12, 2024 · 2 comments

Comments

@baojd42
Copy link

baojd42 commented Aug 12, 2024

Hello! Many thanks to your effort on trying to make django-stubs compatible with Pylance.

I tried this package and the intelliSense for Foreignkey works nicely. However, the other fields such as DecimalField, PositiveSmallIntegerField, etc. are still interferred to Any when being called.

I've added django-autotyping to INSTALLED_APPS, and run the command generate_stubs. The stubs for my models are generated under the folder typings. I then add typings to Pylance's settings python.analysis.stubPath.

Is there anything I missed? Thank you.

@Viicos
Copy link
Owner

Viicos commented Aug 12, 2024

Hello, thanks for the feedback. I'm planning on fixing the issue you are describing directly in the stubs. I have a pending PR for this: typeddjango/django-stubs#1900.

Unfortunately, it requires non trivial changes in the mypy plugin, and I would also like to use a better solution (something as described in microsoft/pyright#6914), but would require mypy to support python/mypy#3737.

@Viicos Viicos closed this as completed Aug 12, 2024
@Viicos
Copy link
Owner

Viicos commented Aug 12, 2024

I'll see if I can add a temporary rule in django-autotyping to basically applies the pending changes I have in the stubs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants