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
Add tests for ClassVar-annotated Migration fields (typeddjango#2702)
For the fields "initial" and "atomic", this is strictly correct, as these are
set on the class, not the instance.
For "operations", "dependencies", "run_before", and "replaces", Django
intentionally copies the class attributes to the instance during construction.
However, annotating the attributes as either (using "|") class or instance
variables causes MyPy to issue the warning: "Cannot override instance variable
(previously declared on base class "Migration") with class variable". Since
Django projects will nearly always override these as class variables, annotate
them as such.
Signed-off-by: Brian Helba <[email protected]>
Signed-off-by: Yury V. Zaytsev <[email protected]>
Co-authored-by: Brian Helba <[email protected]>
0 commit comments