Type checking in python?

matt at nightrealms.com.bbs matt at nightrealms.com.bbs
Sun Jul 16 23:50:03 EDT 2000


It would be nice if I could do something like:

  def my_func(int foo, list bar, Quux quux):
     ...

rather than

  def my_func(foo, bar, quux):
     if not isinstance(quux, Quux):
        raise RuntimeError("param 'quux' must be of class 'Quux'")

Is there any plans on doing this for Python 3000?  Or will something
like this never be a part of Python?



More information about the Python-list mailing list