New submission from Guillaume Knispel <[EMAIL PROTECTED]>: Some 3rd party tracers rely on frame.f_globals["__name__"] to be set to the module name that contains the code currently executed. frame.f_globals["__name__"] is not defined when some code has been generated with exec, which is the way namedtuples are created.
The attached patch set __name__ to '__generated_%s__' % typename in the generated namespace, which is quite handy to see where the code comes from. Indeed if sys._getframe is available it sets __name__ to '__generated_%s__%s__' % (typename, result.__module__) which is even more useful. ---------- components: Library (Lib) files: collections.r59898.patch keywords: patch messages: 67022 nosy: xilun severity: normal status: open title: Add __name__ in globals of generated namedtuple namespace versions: Python 2.6 Added file: http://bugs.python.org/file10361/collections.r59898.patch __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2903> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com