This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eli.bendersky
Recipients eli.bendersky, ncoghlan
Date 2013-05-09.03:46:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
[this came up as part of the Enum discussions. Full details in this thread:]

namedtuple currently uses this code to obtain the __module__ for the class it creates dynamically so that pickling works:

  result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__')

This may not work correctly on all Python implementations, for example IronPython.

To support some way to pickle on all implementations, namedtuple should support a fully qualified name for the class: 

  Point = namedtuple('mymodule.Point', ['x', 'y'])

If the name is a qualified dotted name, it will be split and the first part becomes the __module__.
Date User Action Args
2013-05-09 03:46:56eli.benderskysetrecipients: + eli.bendersky, ncoghlan
2013-05-09 03:46:56eli.benderskysetmessageid: <>
2013-05-09 03:46:56eli.benderskylinkissue17941 messages
2013-05-09 03:46:55eli.benderskycreate