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
Add 2.0 deprecation warnings for the 1.4 second-wave sweep (#263)
One themed PR, mirroring how the 1.3.0 sweep shipped (#253), so every
decided 2.0 removal in the second wave warns ahead of time:
- empty_attribute_default assignment (#255): once None support goes,
the only legal value left is the default, so assignment now warns
via a new descriptor; reads stay silent.
- TupleManager/RegexTupleManager unknown-key attribute access (#256):
a misspelled or omitted key currently degrades silently (None/
EMPTY_REGEX); now warns naming the miss and the known keys.
Excludes single-underscore introspection probes (IPython's
_repr_html_, etc.) alongside the existing dunder guard.
- HumanName slice __getitem__ and all of __setitem__ (#258): field
access by position has no real use case, and item assignment
duplicates plain attribute assignment.
- SetManager.add_with_encoding() (#245): the method itself now warns
on every call regardless of argument type, naming add() as the
replacement -- previously only the bytes-decode path warned.
- Constants.__setstate__'s legacy-pickle migration shim (#279): warns
once per call (not once per skipped key) when it loads a pre-1.3.0
blob, telling users to re-pickle.
Same standards as #253: TDD throughout, suite verified noise-free
including under -W error::DeprecationWarning, mypy/ruff clean, Sphinx
doctest + html builds clean.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/release_log.rst
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,11 @@ Release Log
4
4
5
5
- Add ``Constants.copy()``, a detached deep copy that preserves the source instance's current customizations (unlike ``Constants()``, which always starts from library defaults) -- useful as ``CONSTANTS.copy()`` for a private snapshot of the shared config (#260)
6
6
- Deprecate passing ``constants=None`` to ``HumanName`` (or assigning ``hn.C = None``): it silently builds a fresh ``Constants()``, discarding any customizations the caller may have expected to carry over from the shared ``CONSTANTS``. Emits ``DeprecationWarning``; will raise ``TypeError`` in 2.0. Use ``constants=Constants()`` for fresh library defaults or ``constants=CONSTANTS.copy()`` for a private snapshot instead (closes #260)
7
+
- Deprecate assigning ``Constants.empty_attribute_default`` for removal in 2.0 (#255): once ``None`` support goes, the only legal value left is the default ``''``, so a dial with one position isn't configuration. Emits ``DeprecationWarning``; reading the attribute is unaffected
8
+
- Deprecate unknown-key attribute access on ``TupleManager``/``RegexTupleManager`` (``CONSTANTS.regexes.typo``, ``CONSTANTS.capitalization_exceptions.typo``, etc.) for removal in 2.0 (#256): a misspelled or omitted key currently degrades silently (``None``/``EMPTY_REGEX``) with no traceback pointing at the typo. Emits ``DeprecationWarning`` naming the miss and the known keys; will raise ``AttributeError`` in 2.0. ``.get()`` remains available for intentional soft access
9
+
- Deprecate ``HumanName`` slice access (``name[1:-3]``) and item assignment (``name['first'] = value``) for removal in 2.0 (#258): field access by position has no real use case, and item assignment duplicates plain attribute assignment. Both emit ``DeprecationWarning``; string-key access (``name['first']``) is unaffected
10
+
- Deprecate ``SetManager.add_with_encoding()`` itself for removal in 2.0 (#245), regardless of argument type: use ``add()`` instead (decoding bytes first). Previously only the ``bytes`` path warned; the ``str`` path was silent even though the whole method goes away
11
+
- Deprecate loading a legacy-format ``Constants`` pickle (written by nameparser <= 1.2.x, before the 1.3.0 pickle fix) for removal in 2.0 (#279): ``__setstate__``'s migration shim currently skips the stale computed-property key silently. Emits ``DeprecationWarning`` once per call telling users to re-pickle; will raise ``ValueError`` in 2.0
7
12
- Fix the ``"Lastname, Firstname"`` comma format not being recognized when the input uses the Arabic comma ``،`` (U+060C, the standard comma in Arabic/Persian/Urdu text) or the fullwidth CJK comma ``,`` (U+FF0C) instead of the ASCII comma: both variants now also split the format and no longer leak into the parsed output (closes #265)
0 commit comments