Skip to content

Partition Sets

Consolidation of existing third party recipes for partitioning of sets and multisets/bags.

Partition Sets provides a consolidated set of recipes gently provided by other users over the years and under the MIT license. I modified these slightly so that they now equally work under python2 and python3. All bugs are mine ;-)

You may find it useful for tasks involving small sets and also multi sets/bags.

License: MIT

Third party dependencies are documented in the folder third-party.

version downloads wheel supported-versions supported-implementations

Bug Tracker

Feature requests and bug reports are best entered in the todos of partitionsets.

Primary Source repository

The main source of partitionsets is on a mountain in central Switzerland. We use distributed version control (git). There is no central hub. Every clone can become a new source for the benefit of all. The preferred public clones of partitionsets are:

  • on codeberg - a democratic community-driven, non-profit software development platform operated by Codeberg e.V.
  • at sourcehut - a collection of tools useful for software development.

Thanks also to

This package merely wraps up several recipes (and comments) gently provided under the MIT license through several people. Those I noticed have been noted below. Any missing names are my fault. In case I get notified, I will try to update, add or remove items in below lists accordingly.

Partition

  • Anton Vredegoor
  • Chris Haulk

OrderedSet

  • Don Sawatzky
  • Emil Wall
  • Raymond Hettinger

Misc

  • Nathan Hurst send feedback and a patch for version 0.1.1 - thanks

For further reference please see the comments of the module files.

References

[A0001101]: "Bell or exponential numbers: ways of placing n labeled balls into n indistinguishable boxes." at http://oeis.org/A000110

[BellNumber]: Wikipedia entry Bell_number at https://en.wikipedia.org/wiki/Bell_number

[OEIS]: Wikipedia entry On-Line_Encyclopedia_of_Integer_Sequences at https://en.wikipedia.org/wiki/On-Line_Encyclopedia_of_Integer_Sequences

[OrdSetImplPy]: https://code.activestate.com/recipes/576694/ (mixed with the simplified code from Don Sawatzky's comment, which is sufficient for this task)

[PartOfASet_WP]: Wikipedia entry Partition_of_a_set at https://en.wikipedia.org/wiki/Partition_of_a_set