[issue16028] break in finally discards exception
Erik Allik added the comment: It looks to me that it was not removed from the doc but explicitly changed to say that 'break' does not cause the exception to be discarded, unless I'm misunderstanding it: 1.20 +:keyword:`finally` clause is executed. If there is a saved exception 1.21 +or :keyword:`break` statement, it is re-raised at the end of the 1.22 +:keyword:`finally` clause. If the :keyword:`finally` clause raises -- ___ Python tracker <http://bugs.python.org/issue16028> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16028] break in finally discards exception
New submission from Erik Allik: This is either a bug, or a very weird but undocumented feature/caveat. def fn1(): while True: try: raise Exception() finally: pass def fn2(): while True: try: raise Exception() finally: break # <- fn1() # exception, as expected fn2() # silence! -- messages: 171168 nosy: eallik priority: normal severity: normal status: open title: break in finally discards exception type: behavior versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue16028> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15801] Weird string interpolation behaviour
Erik Allik added the comment: Respectable reaction time. -- ___ Python tracker <http://bugs.python.org/issue15801> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15801] Weird string interpolation behaviour
New submission from Erik Allik: >>> class Foo(object): ... pass ... >>> "asdads" % Foo() 'asdads' Doesn't look like it's supposed to be this way. As per the documentation: "If format requires a single argument, values may be a single non-tuple object. [5] Otherwise, values must be a tuple with exactly the number of items specified by the format string, or a single mapping object (for example, a dictionary)." Tested and confirmed on 2.5, 2.6, 2.7 (both old and new style classes) and 3.2. -- messages: 169300 nosy: eallik priority: normal severity: normal status: open title: Weird string interpolation behaviour type: behavior versions: Python 2.6, Python 2.7, Python 3.2 ___ Python tracker <http://bugs.python.org/issue15801> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com