[Python-3000] Py3.0 Library Ideas

Raymond Hettinger python at rcn.com
Fri Feb 16 01:48:51 CET 2007

* Remove the unreliable empty() and full() methods from Queue.py

* Remove jumpahead() from the random API.  It is somewhat uncommon for PRNGs to 
have a closed form solution that jumpsahead N steps.

* Make the primative for random be something generating random bytes rather than 
random floats.  Currently to get a random integer, a generator like the Mersenne 
twister generates two blocks of 4 bytes, which are then turned into a C double 
and then random.py module converts the float back into an integer in the desired 
range.  The long-->float-->long dance could be abbreviated.  This would also 
make it easier to substitute in other generators without making them responsible 
for the long-->float step.

* Get rid of Cookie.SerialCookie and Cookie.SmartCookie

* Modify the heapq.heapreplace() API to compare the new value to the top of the 
heap.  This has come-up more than once.  When using a heap for a priority queue, 
sometimes there is a need to revise the priority of an entry in the middle of 
the heap.  This can be done with heapreplace substituting the new priority/task 
pair and then running a _siftup operation to restore the heap condition.


More information about the Python-3000 mailing list