simple try/except question

Alan Isaac aisaac at american.edu
Mon Oct 29 11:46:37 EDT 2007


Is the behavior below expected?
If so, why is the exception not caught?
Thanks,
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