In order to add a new Value you have to add a method in value.Inspect and then add a subclass of value.Value, then you have to call your new Inspect method in the Inspect.typename property because certain methods need to be called before others (eg, is_path needs to be called before is_object because otherwise a pathlib.Path instance would just be treated like a vanilla object.
I think I can infer the order by looking at the parent classes, so if a child class inherits from another child class, then the former would be called before the latter. So if you had 5 classes that all extended ObjectValue they would all be called before ObjectValue.
I would just need to move the checking methods onto the Value object, and then have something that organizes the order and calls them, so to add a new value you would just need to add a Value subclass
In order to add a new
Value
you have to add a method invalue.Inspect
and then add a subclass ofvalue.Value
, then you have to call your newInspect
method in theInspect.typename
property because certain methods need to be called before others (eg,is_path
needs to be called beforeis_object
because otherwise apathlib.Path
instance would just be treated like a vanilla object.I think I can infer the order by looking at the parent classes, so if a child class inherits from another child class, then the former would be called before the latter. So if you had 5 classes that all extended
ObjectValue
they would all be called beforeObjectValue
.I would just need to move the checking methods onto the
Value
object, and then have something that organizes the order and calls them, so to add a new value you would just need to add aValue
subclass