Open dbushy727 opened 2 years ago
That's really weird pylance is erroring about Literal
, I think we have some test cases that use that functionality
Locally I've tried importing Literal from typing
rather than typing_extensions
(python 3.9) and that seems to improve things. I think maybe pyright isn't treating typing_extensions.Literal
correctly any more?
I've noted this on the pyright project here: https://github.com/microsoft/pyright/issues/3936
Never mind, this was a bug in my environment.
Thank you so much for this package. It really has helped bring so much more visibility into my codebase. 🙏
One thing I'm struggling with is setting the right type when I have a nullable Model field. I find that when i look at an instance of the model, it shows me the value or none, but when trying to set None, i get a type error.
Django version: 3.2.10 Python version: 3.10.1
Ive tried playing with the annotation and I can't seem to get it to work. I think this may be a bug in how the generic handles None.
When looking at the stub file for DecimalField, I noticed that i see a type error for the null field.
I think the Literal is the problem and if we use the one from
typings
it works for me, but im not sure if there are downstream effects.I'll submit a PR to showcase what im talking about. Please let me know if this is something im doing wrong, or something we can address to fix. Any help would be super appreciated, thanks!