Skip to content

constants argument silently discards Constants subclasses #226

Description

@derek73

__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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions