__init__ does if type(self.C) is not type(CONSTANTS): self.C = Constants() (parser.py:115) to support constants=None, but the exact-type check means a user passing an instance of a Constants subclass gets it silently replaced with fresh defaults — their configuration is discarded without any error.
Fix: change to if constants is None: self.C = Constants(), and raise TypeError for anything that is neither None nor a Constants instance.
__init__doesif type(self.C) is not type(CONSTANTS): self.C = Constants()(parser.py:115) to supportconstants=None, but the exact-type check means a user passing an instance of aConstantssubclass gets it silently replaced with fresh defaults — their configuration is discarded without any error.Fix: change to
if constants is None: self.C = Constants(), and raiseTypeErrorfor anything that is neitherNonenor aConstantsinstance.