-
I have this line of code:
Running mypy results in this error:
Functionally, it seems to work to convert the mappingproxy into a dict. How could I make typing happy? |
Beta Was this translation helpful? Give feedback.
Answered by
Daverball
Aug 26, 2023
Replies: 1 comment 5 replies
-
What exactly is the type of |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since you're always using
type[_FSA_MC]
you should probably change it to:And change all the annotations to use
_FSA_MCT
, rather thantype[_FSA_MC]
. If there are any functions that accept any instance that's derived from a class that usesDeclarativeMeta
, you probably won't get around changing_FSA_MC
to an unboundedTypeVar
, or to one that's bound to a Protocol which contains properties that all models should have, if you want to support any custom base class that uses the metaclass.