[Python-Dev] Re: Python-Dev Digest, Vol 9, Issue 17 (original) (raw)

Guido van Rossum guido at python.org
Mon Apr 5 19:30:23 EDT 2004


One thing I was thinking about (aloud on #python) was a validator syntax, something resembling:

def isint(i): return isinstance(number, int): def ishashable(h): try: hash(h) return True except TypeError: return False # or raise exception def func(isint : number, hashable : key): # code...

Please note that you seem to be using the syntax type: variable''. We've settled on using variable: type'' instead. (How to express types is quite a different story...)

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list