Skip to content

Stricter checks and atomic containers

Compare
Choose a tag to compare
@ivannz ivannz released this 21 Feb 11:32
· 27 commits to main since this release

In this release the core nested container detection and handling logic of plyr has been made more strict.

Now, unless specified otherwise, subclasses of tuple, dict and list are never traversed. The notable exception is Namedtuples, which plyr still descends into, since it considers them as frozen dict containers. Checking for NTs has become more robust: now we additionally check the type's .mro() to be exacltly [cls, tuple, object]. This will misdetect objects, that really wants to pass off as namedtuples.

Additionally, we have implemented special Atomic subclasses of dict, list and tuple, which plyr will not descend into.