Skip to content

Config Inheritance #2616

Answered by layday
wackazong asked this question in Question
Apr 1, 2021 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Mypy is correct, the two config classes are incompatible with each other, in the same way that you cannot assign an object of class A to a variable declared to be a B if one does not inherit from the other:

class A: ...
class B: ...

class Model:
    a: A

class Submodel(Model):
    a: B  # Invalid

The confusion arises here from the classes being synonymous.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wackazong
Comment options

Answer selected by wackazong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants