Method/Function Signature Type checking

Adam Gent agentgt at
Tue Aug 13 19:32:10 CEST 2002

I'm almost certain that this has been brought up in the newsgroup
before but I can't seem to google it (find it). I like python very
much but was wondering if there is any intrest for dynamic type
checking in the method/function signature. Im not talking about
compile time/static type checking!

def blah( String st):

#Would be equal to 

def blah(st):
    if isinstance(st, String):
        raise TypeError
        #do whatever

I think this feature would be very useful to the programmer for
obvious reasons (abstract classes, source code tagging ... so on). I'm
sure this has been talked about before so pointer to previous
discussions and or PEPs would be appreciated.

More information about the Python-list mailing list