[issue25474] Weird behavior when setting f_trace in a context manager
New submission from Fred Gansevles: I'm playing with the idea of making a DSL based on anonynous code blocks I discovered that the behaviour of the context manager is different in some cases if there are line-continuations in the 'with' command I've attached a script that reproduces this behaviour. With both Python 2.7.6 and Python 3.4.3 I get the same results. Fred. -- files: as_context.py messages: 253426 nosy: Fred Gansevles priority: normal severity: normal status: open title: Weird behavior when setting f_trace in a context manager type: behavior Added file: http://bugs.python.org/file40858/as_context.py ___ Python tracker <http://bugs.python.org/issue25474> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25474] Weird behavior when setting f_trace in a context manager
Fred Gansevles added the comment: Xavier, thanks for looking at my post. But, since all six invocations of the context manager are the same - I did an 'ast.parse' and 'ast.dump' and the the six calls were *exactly* the same (save lineno and col_offset) - why does 'zero', 'one', 'four' and 'five' get assigned but 'two' and 'three' not ? -- ___ Python tracker <http://bugs.python.org/issue25474> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25474] Weird behavior when setting f_trace in a context manager
Fred Gansevles added the comment: Xavier, thanks! you found it. If I look the code again, I see that with zero, one, four and five the context-manager (i.e. Context()) and the target (one .. five) are on the same code-line In the case of two and three they are on a different line. Now, with the dependency of the trace function on the *physical line* it all make sense. Fred. -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue25474> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com