A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-September/068665.html below:

[Python-Dev] Exception message for invalid with statement usage

[Python-Dev] Exception message for invalid with statement usage [Python-Dev] Exception message for invalid with statement usageGeorg Brandl g.brandl at gmx.net
Wed Sep 6 14:41:19 CEST 2006
Current trunk:

>>> with 1:
...  print "1"
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'int' object has no attribute '__exit__'

Isn't that a bit crude? For "for i in 1" there's a better
error message, so why shouldn't the above give a
TypeError: 'int' object is not a context manager

?

Georg

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4