[PEAK] dispatch bug

Radek Kanovsky rk at dat.cz
Thu Feb 10 12:44:29 EST 2005


Hi,

following generic function doesn't raise NoApplicableMethods exception
for 'object' as argument but fails with KeyError exception. This has
something to do with recent optimizations but I am not able to say where
is the problem yet.

    from peak.core import *

    [dispatch.generic()]
    def gm (arg) :
        pass

    [gm.when("issubclass(arg,int)")]
    def gm_int (arg) :
        return "int"

    print gm(int)
    print gm(object)

RadekK



More information about the PEAK mailing list