You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disclaimer: mypy newbie here, so I might just be missing something. See also my StackOverflow question for my motivation to request this feature.
Basically I couldn't find a way for mypy to require type annotations on class attributes as in the following (incomplete) example with ignore_missing_imports turned on for sqlalchemy.*.
I want code using my library (ORM definitions) to know what types they can expect. So I need mypy to make sure that oid is type annotated (e.g. oid: int = ...).
disallow_any_unimported does not seem to apply for oid. I also tried disallow_any_expr but this seems far to broad and has side-effects like causing mypy to complain about the use of Integer (Even with disallow_any_unimported = False).
The text was updated successfully, but these errors were encountered:
I would find this useful too! I wouldn't mind if the expression was explicitly annotated as Any, I just want to force people to think about assigning types to all instance variables on a class.
Disclaimer: mypy newbie here, so I might just be missing something. See also my StackOverflow question for my motivation to request this feature.
Basically I couldn't find a way for mypy to require type annotations on class attributes as in the following (incomplete) example with
ignore_missing_imports
turned on forsqlalchemy.*
.I want code using my library (ORM definitions) to know what types they can expect. So I need mypy to make sure that
oid
is type annotated (e.g.oid: int = ...
).disallow_any_unimported
does not seem to apply foroid
. I also trieddisallow_any_expr
but this seems far to broad and has side-effects like causing mypy to complain about the use ofInteger
(Even withdisallow_any_unimported = False
).The text was updated successfully, but these errors were encountered: