0

The structure I have looks like this:

Parent(abc.ABCMeta) -> Foo(Parent)

Parent(abc.ABCMeta) -> SubParent(abc.ABCMeta, Parent) -> Bar(SubParent)

Then, say we have instances like so,

x = Foo()
t = Bar()

From this design, is it possible to answer the question,
x is _not_ an instance of some abstract class that extends Parent?

I understand that taking a high-level look at this might seem like some design smell.

Debosmit Ray
  • 5,228
  • 2
  • 27
  • 43
  • Definitely a design smell. Also, `abc.ABCMeta` is a metaclass. If you want to write an abstract base class, you should be using `ABCMeta` as a metaclass, not extending it. Also, `SubParent` doesn't need to re-specify `ABCMeta`. – user2357112 Nov 26 '17 at 20:58
  • @user2357112 ah yes -- its actually a metaclass, in code usage is `@six.add_metaclass(abc.ABCMeta)`. Apologies for the bad representation there. Regardless, I think bad design pattern should be fixed on my part, instead of trying such approaches that _kind of cover it up_. Voting to close the question, post this discussion. – Debosmit Ray Nov 26 '17 at 22:21

0 Answers0