from Hacker News

Show HN: Mutuple – Replace items in Python's "immutable" tuples

by davvid on 4/11/24, 2:45 AM with 1 comments

  • by davvid on 4/11/24, 4:10 AM

    While I mostly wrote `mutuple` for fun, it's also a proof of concept for solving a tricky pickling problem in the jsonpickle[1] library: restoring object graphs that contain tuples with back-references to the same tuple.

    I'm pretty sure there are better ways of handling this edge case, but, hey, it works and was a pretty fun experiment.

    [1] https://github.com/jsonpickle/jsonpickle/pull/491