[Python-Dev] PEP 443 - Single-dispatch generic functions

PJ Eby pje at telecommunity.com
Fri May 24 02:31:48 CEST 2013

On Thu, May 23, 2013 at 6:58 PM, Ben Hoyt <benhoyt at gmail.com> wrote:
> It seems no one has provided
> decent use-case examples (apart from contrived ones)

Um, copy.copy(), pprint.pprint(), a bunch of functions in pkgutil
which are actually *based on this implementation already* and have
been since Python 2.5...  I don't see how any of those are contrived
examples.  If we'd had this in already, all the registration-based
functions for copying, pickling, etc. would likely have been
implemented this way, and the motivating example for the PEP is the
coming refactoring of pprint.pprint.

More information about the Python-Dev mailing list