[Python-Dev] Py2.6 ideas

Raymond Hettinger raymond.hettinger at verizon.net
Thu Feb 15 20:59:38 CET 2007


* Teach vars() to work with classes defining __slots__.  Essentially, __slots__ 
are just an implementation detail designed to make instances a bit more compact.

* Make the docstring writable for staticmethods, classmethods, and properties. 
We did this for function objects and it worked-out well.

* Have staticmethods and classmethods automatically fill-in a docstring from the 
wrapped function.  An editor's tooltips would benefit nicely.

* 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

* Give builtin types a __name__ attribute so that we have a uniform way of 
accessing type names.

* Enhance doctest with a method that computes updated doctest results.  If the 
only change I make to a matrix suite is to add commas to long numbers in the 
matrix repr(), then it would be nice to have an automated way to update the 
matrix output on all the other test cases in the module.

* add an optional position argument to heapq.heapreplace to allow an arbitrary 
element to be updated in-place and then have the heap condition restored.  I've 
now encountered three separate parties trying to figure-out how to do this.




More information about the Python-Dev mailing list