[Python-ideas] PEP 443 - multiple types registered

alex23 wuwei23 at gmail.com
Thu Jun 6 03:03:35 CEST 2013


On Jun 6, 10:28 am, João Bernardo <jbv... at gmail.com> wrote:
> The  fact is that I still feel that register could allow a tuple of types
> without compromising the API. Maybe a "register_many" could be added then...

Isn't it simple enough to do yourself?

    def register_many(types):
        def _register_many(fn):
            for t in types:
                fun.register(type)(fn)
            return fn
        return _register_many


More information about the Python-ideas mailing list