The type of the SomeParam
class object is not Param
, it's ParamMeta
, and type()
correctly reports that. You're confusing the is-a and inherits-from relationships. A SomeParam
instance is-a Param
. The SomeParam
class object, on the other hand, inherits from the Param
class object, but it is not an value of type Param
.
For subclass relationships, there is the builtin issubclass()
, which is the analogue of isinstance
for is-a relationships: issubclass(SomeParam, Param)
is true.
Edit: There is nothing you can do to achieve type(SomeParam)
returning Param
, except of course shadowing the name type
with a hand-written function that returns the base class (which would be extremely misleading and bad style).