[Python-Dev] PEP 443 - Single-dispatch generic functions (including ABC support)

Łukasz Langa lukasz at langa.pl
Fri May 31 01:51:50 CEST 2013


On 31 maj 2013, at 01:47, Łukasz Langa <lukasz at langa.pl> wrote:

> class State:
>    def __init__(self):
>        self.add.register(int, self.add_int)


Ouch, I realized this is wrong just after I hit "Send". self.add is a staticmethod so this registration will overload on every instance. Which is obviously bad.

Lesson learned: don't post code at 2 AM.

-- 
Best regards,
Łukasz Langa

WWW: http://lukasz.langa.pl/
Twitter: @llanga
IRC: ambv on #python-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130531/ae1f11fc/attachment.html>


More information about the Python-Dev mailing list