plum icon indicating copy to clipboard operation
plum copied to clipboard

Problems with Union Aliases in Python 3.14

Open nstarman opened this issue 1 month ago • 1 comments

In Python 3.14 typing.Union is immutable and the following error is raised

.../plum/alias.py:131: in activate_union_aliases
    _union_type.__repr__ = _new_repr
    ^^^^^^^^^^^^^^^^^^^^
E   TypeError: cannot set '__repr__' attribute of immutable type 'typing.Union'

nstarman avatar Nov 23 '25 23:11 nstarman

@nstarman Hmm, we'll probably need to abandon this approach and might need to abandon union aliases all together. Perhaps not a huge deal since overriding Union.__repr__ was a little dodgy anyway.

wesselb avatar Nov 24 '25 10:11 wesselb