Movatterモバイル変換
[0]ホーム
ANN: mxNumber -- Experimental Number Types, Version 0.2.0
Steve Holdensholden at holdenweb.com
Fri Apr 27 15:39:13 EDT 2001
"Brian Kelley" <kelley at bioreason.com> wrote in messagenews:3AE9C0E2.64A87C9A at bioreason.com...> I have taken the opportunity to expose a couple of Integer methods>> Integer.popcount() - number of bits set> Integer.setbit(bit) - set the bit indicated by bit> Integer.clrbit(bit) - set the bit indicated by bit>> These are very useful for Aritificial Intelligence/feature vectoralgorithms. Is> there any other desire to see these types of functions exposed? I wouldbe happy to> send a patch although it's only 3 minutes of work to do...>> The other question I have is about pickling: I noticed that the pickledstructures> use a string to determine the "long" representation. This is somewhatwasteful for> storage considerations. Is there any chance for a compressed version ofthe long> representation? I would be more than happy to look into this, I justdon't know if> it is feasible.>>From 2.0 library reference manual, section 3.11:"""A binary format, which is slightly more efficient, can be chosen byspecifying a nonzero (true) value for the bin argument to the Picklerconstructor or the dump() and dumps() functions. The binary format is notthe default because of backwards compatibility with the Python 1.4 picklemodule. In a future version, the default may change to binary."""For speed you should use cPickle unless you need to subclass the picklers -it reportedly runs much faster.regards StEvE
More information about the Python-listmailing list
[8]ページ先頭