[Types-sig] Run time arg checking implemented

Skip Montanaro skip@mojam.com (Skip Montanaro)
Thu, 30 Dec 1999 09:46:34 -0600 (CST)


    skaller> I have implemented run time argument checking in Viper, using
    skaller> Greg's ! operator. The syntax (so far) is like:

    skaller> 	def f( p ! t = dflt): pass

    skaller> and the semantics are to check that an argument has the
    skaller> nominated type:

    skaller> 	f(a) 

    skaller> checks like:

    skaller> 	if type(a) is not t:
    skaller> 		raise TypeError "messge"

Any reason this isn't

    assert type(a) is t

?

Skip Montanaro | http://www.mojam.com/
skip@mojam.com | http://www.musi-cal.com/
847-971-7098   | Python: Programming the way Guido indented...