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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com