In VS Code, I’m using pylance
due to it’s speed, even though it’s less correct than mypy
with the django-stubs
plugin. Unfortunately, one of it’s quirks is that it thinks all get_foo_display
usages are unknown attribute accesses and flags them for errors.
Does anyone know a way to avoid these errors for pylance, or maybe an easy way to replicate the instance.get_foo_display()
behaviour in a helper function? I’m thinking some function like get_display(instance, 'foo')
could be used (even though that would lose mypy coveage).