Skip to main content
Help us improve Python packaging – donate today!

Generic functions. Clever registries and lookups

Project Description

Reg: Clever Registries and Lookups

Reg is a Python library that provides generic function support to Python. It help you build powerful registration and configuration APIs for your application, library or framework.



0.8 (2014-08-28)

  • Added a @reg.classgeneric. This is like @reg.generic, but the first argument is treated as a class, not as an instance. This makes it possible to replace @classmethod with a generic function too.
  • Fix documentation on running documentation tests. For some reason this did not work properly anymore without running sphinxpython explicitly.
  • Optimization: improve performance of generic function calls by employing lookup_mapply instead of general mapply, as we only care about passing in the lookup argument when it’s defined, and any other arguments should work as before. Also added a which is a simple generic function timing script.

0.7 (2014-06-17)

  • Python 2.6 compatibility. (Ivo van der Wijk)
  • Class maps (and thus generic function lookup) now works with old style classes as well.
  • Marked as production/stable now in

0.6 (2014-04-08)

  • Removed unused code from
  • Typo fix in API docs.

0.5 (2014-01-21)

  • Make reg.ANY public. Used for predicates that match any value.

0.4 (2014-01-14)

  • arginfo has been totally rewritten and is now part of the public API of reg.

0.3 (2014-01-06)

  • Experimental Python 3.3 support thanks to the future module.

0.2 (2013-12-19)

  • If a generic function implementation defines a lookup argument that argument will be the lookup used to call it.
  • Added reg.mapply(). This allows you to call things with more keyword arguments than it accepts, ignoring those extra keyword args.
  • A function that returns None is not assumed to fail, so no fallback to the original generic function is triggered anymore.
  • An optional precalc facility is made available on Matcher to avoid some recalculation.
  • Implement a specific PredicateMatcher that matches a value on predicate.

0.1 (2013-10-28)

  • Initial public release.

Release history Release notifications

History Node


History Node


History Node


History Node


History Node


History Node


This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date (56.2 kB) Copy SHA256 hash SHA256 Source None Aug 28, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page