Skip to content

Deprecate slice __getitem__ and __setitem__ on HumanName #258

Description

@derek73

The list/dict emulation on HumanName is wider than its value:

  • name[1:-3] slices the internal members list positionally — the oddest surviving API (currently a usage.rst example); field access by position has no real use case
  • name['first'] = x duplicates plain attribute assignment

Keep: name['first'] string-key access (harmless, useful for dynamic field names), and __iter__/__len__len(name) == 0 was enshrined in 1.3.0 as the emptiness check when unparsable was removed, and __str__ iterates for the string_format=None path.

Bridge (1.4) — tracked in #263

  • DeprecationWarning on slice __getitem__ and on __setitem__
  • Replace the usage.rst slicing example

Metadata

Metadata

Assignees

Labels

breaking-changeBackwards-incompatible API change

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions