anthony tolle pkfrwatpbgmailcom sun mar 9 2008 554 greg ewing wrote anthony tolle wrote concrete example imagine wrapper using inspect module gather information stack frame passing along selected methods thats still concrete doesnt demonstrate would want find particular piece information ok something hope concrete enough yet another version autosuper put together python 25 since doesnt magic version super 30 rather write new super function wanted write something would work inserting correct value super argument list fact script brought whole discussion point script moot version 30 still concrete example ive discussing realized check static method wouldnt work 30 began wonder anyone else run across problem even cared heres script includes assertions test behavior class autosuper_methodobject def __init__self desc clsnone selfdesc desc selfcls cls def __get__self obj typenone return autosuper_callableselfdesc selfcls selfdesc__get__obj type class autosuper_callableautosuper_method def __init__self desc cls callable selfdesc desc selfcls cls selfcallable callable def __call__self args kwargs selfcls none raise typeerrormust inherit autosuper try obj selfcallableim_self except attributeerror raise typeerrorautosuper used static method obj none obj args0 return selfcallable__call__obj superselfcls obj args1 kwargs return selfcallable__call__superselfcls obj args kwargs class autosuper_metatype def __init__cls name bases clsdict fix autosuper_method instances class attr clsdictkeys value clsdictattr isinstancevalue autosuper_method type__setattr__cls attr autosuper_methodvaluedesc cls def __setattr__cls attr value catch assignment class definition isinstancevalue autosuper_method value autosuper_methodvaluedesc cls type__setattr__cls attr value class autosuperobject __metaclass__ autosuper_meta __name__ __main__ class aautosuper classmethod def cmcls return clsname def imself return selfname demo standard use class ba autosuper_method classmethod def cmcls super return b supercm autosuper_method def imself super return b superim demo reference super inner function class ca autosuper_method classmethod def cmcls super def inner return c supercm return inner autosuper_method def imself super def inner return c superim return inner demo define function class definition autosuper_method classmethod def d_cmcls super return supercm autosuper_method def d_imself super return superim class db c name def __init__self name selfname name cm d_cm im d_im demo define functions class definition class eb c name e def __init__self name selfname name autosuper_method classmethod def e_cmcls super return e supercm autosuper_method def e_imself super return e superim ecm e_cm eim e_im test dd assert dcm dbcad class method instance binding assert dcm dbcad class method class binding assert dim dbcad instance method instance binding assert dimd dbcad instance method class binding test e e ee assert ecm ebcae class method instance binding assert ecm ebcae class method class binding assert eim ebcae instance method instance binding assert eime ebcae instance method class binding give e cm im ecm dcm eim dim assert ecm dbcae class method instance binding assert ecm dbcae class method class binding assert eim dbcae instance method instance binding assert eime dbcae instance method class binding imagine next question version autosuper doesnt work static methods doesnt make sense would since super works bound would care couldnt check static methods assume used class methods instance methods adjust code accordingly well question beginning writing wrapper like would anyone care could longer distinguish static methods unbound methods python 30 far sounds like answer fine thought id bring everyones attention _______________________________________________ python3000 mailing list smsbmo9552pythonorg httpmailpythonorgmailmanlistinfopython3000 unsubscribe httpmailpythonorgmailmanoptionspython3000python300040tangomucom wed 06 aug 2008 020127 0400 python3000 case unbound methods