You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make HumanName.C a property so post-construction assignment is validated
#226 validated the `constants` argument in HumanName.__init__, but `C` was a
plain attribute, so `hn.C = 'garbage'` bypassed validation entirely and only
surfaced as an unrelated AttributeError deep inside parsing. Extract
_validate_constants as a shared staticmethod used by both the constructor and
the new C property setter, so both paths raise the same immediate TypeError.
__getstate__/__setstate__ are updated to translate the internal _C storage
attribute to/from the same 'C' key they always pickled, so the on-disk pickle
format (and the CONSTANTS-singleton sentinel) is unchanged.
Fixes#239
0 commit comments