A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-February/071284.html below:

[Python-Dev] Py2.6 ideas

[Python-Dev] Py2.6 ideas [Python-Dev] Py2.6 ideasFuzzyman fuzzyman at voidspace.org.uk
Tue Feb 20 11:17:49 CET 2007
Michele Simionato wrote:

>Raymond Hettinger <raymond.hettinger <at> verizon.net> writes:
>  
>
>>* Add a pure python named_tuple class to the collections module.  I've been 
>>using the class for about a year and found that it greatly improves the 
>>usability of tuples as records. 
>>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/500261
>>    
>>
>[snip..]
>4. I want help(MyNamedTuple) to work well; in particular it should
>   display the right module name. That means
>   that in the m dictionary you should add a __module__ attribute:
>   
>    __module__ = sys._getframe(1).f_globals['__name__']
>
>  
>
Hello all,

If this is being considered for inclusion in the standard library, using _getframe' hackery will guarantee that it doesn't work with alternative implementations of Python (like IronPython at least which doesn't have Python stack frames).

At least wrapping it in a try/except would be helpful.

All the best,

Michael Foord
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4