diff options
Diffstat (limited to 'Lib/collections.py')
-rw-r--r-- | Lib/collections.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/collections.py b/Lib/collections.py index f746145..73fc150 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -93,8 +93,9 @@ def namedtuple(typename, field_names, verbose=False): if verbose: print(template) - # Execute the template string in a temporary namespace - namespace = dict(itemgetter=_itemgetter) + # Execute the template string in a temporary namespace and + # support tracing utilities by setting a value for frame.f_globals['__name__'] + namespace = dict(itemgetter=_itemgetter, __name__='namedtuple_%s' % typename) try: exec(template, namespace) except SyntaxError as e: |