Skip to content

frozendict v2.5.0

Choose a tag to compare

@Marco-Sulla Marco-Sulla released this 30 Oct 00:48
· 11 commits to master since this release

What's Changed

Breaking changes

  • Removed frozendict.__deepcopy__. deepcopy() now always returns a copy, even if the frozendict is hashable.
  • Pure py: | accepts only dict and frozendict, like the C Extension and dict.

Speed

  • C Extension: freelists for frozendicts and keys make creating small frozendicts faster: the constructor, set() and delete().
  • C Extension: frozendicts take less memory in some cases.
  • Pure py: faster set, setdefault, delete and |.
  • fd | {} and frozendict() | fd now return fd immediately.

Fixes

  • set, setdefault, delete and | could return a frozendict not tracked by the GC, so its reference cycles were never collected.
  • Pure py: deepcopy() of a recursive frozendict no longer raises RecursionError.
  • Pure py: dict | frozendict now also works on Python 3.8 and earlier.
  • fromkeys() with an empty iterable now returns the empty singleton.
  • Fixed crashes, reference leaks and missing error checks in the C Extension. Also fixed from frozendict import *, the signature of set in the stub, and the silent fallback to pure py when the C Extension fails to load, which now emits a warning. Thanks to @devdanzin for the audit.
  • Typing: fixed items, keys, values, __ror__ and setdefault(key).

by @Marco-Sulla in #120

Other Fixes

  • Use built-in Self type in __init__.pyi when available by @adriengcql in #114
  • Fix C extension build for unsupported Python versions by @jvulgan in #117
  • Recursively freeze fallback object attributes by @muneikh in #118

New Contributors

Full Changelog: v2.4.7...v2.5.0