simple try/except question

Alan Isaac aisaac at
Mon Oct 29 16:46:37 CET 2007

Is the behavior below expected?
If so, why is the exception not caught?
Alan Isaac

>>> x,y='',''
>>> try: x/y
... except TypeError: print 'oops'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for /: 'str' and 'str'

More information about the Python-list mailing list