Type checking in python?

Matthew Cline matt at nightrealms.com
Mon Jul 17 00:51:10 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