This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.moore
Recipients ncoghlan, paul.moore
Date 2009-02-02.19:57:33
SpamBayes Score 3.21852e-07
Marked as misclassified No
Message-id <>
This patch takes the existing "simplegeneric" decorator, currently an
internal implementation detail of the pkgutil module, and exposes it as
a feature of the functools module.

Documentation and tests have been added, and the pkgutil code has been
updated to use the functools implementation.

Open issue: The syntax for registering an overload is rather manual:

    def xxx_impl(xxx):
    generic_fn.register(XXX, xxx_impl)

It might be better to make the registration function a decorator:

    def xxx_impl(xxx):

However, this would involve changing the existing (working) code, and I
didn't want to do that before there was agreement that the general idea
(of exposing the functionality) was sound.
Date User Action Args
2009-02-02 19:57:40paul.mooresetrecipients: + paul.moore, ncoghlan
2009-02-02 19:57:40paul.mooresetmessageid: <>
2009-02-02 19:57:38paul.moorelinkissue5135 messages
2009-02-02 19:57:37paul.moorecreate