File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -875,11 +875,18 @@ base classes and type decorators that do ``dataclass`` like things.
875875 This can only be used in the return type of a type decorator
876876 or as the return type of ``__init_subclass__ ``.
877877
878+ When a class is declared, if one or more of its ancestors have an
879+ ``__init_subclass__ `` with an ``UpdateClass `` return type, they are
880+ applied in reverse MRO order. N.B: If the ``cls `` param is
881+ parameterized by ``type[T]] ``, then the class type should
882+ substituted in for ``T ``.
883+
878884One snag here: it introduces type-evaluation-order dependence; if the
879885``UpdateClass `` return type for some ``__init_subclass__ `` inspects
880886some unrelated class's ``Members `` , and that class also has an
881- ``__init_subclass__ ``, then the results might depend on what order they
882- are evaluated.
887+ ``__init_subclass__ ``, then the results might depend on what order
888+ they are evaluated. Ideally this kind of case would be rejected,
889+ which I think ought to be possible?
883890
884891This does actually exactly mirror a potential **runtime **
885892evaluation-order dependence, though.
You can’t perform that action at this time.
0 commit comments