Hi, On Tue, Dec 21, 2010 at 9:58 AM, Arnd Rechenburg <[email protected]> wrote: > In my code I need something like > > long.__itemsize__ > > in Python.
I suppose the question is "why"? This is supposed to be the size in bytes occupied by one "element" of the type, and one element of "long" happens to be 15 bits, so that's why long.__itemsize__ is 2. It has no other meaning. If you are interested in an estimate of how many bytes some actual object takes, we have some functions in the 'gc' module, but even that is incomplete -- there are cases were it's hard to come up with a definitive answer, like objects based on "mapdicts". A bientôt, Armin. _______________________________________________ [email protected] http://codespeak.net/mailman/listinfo/pypy-dev
