find the length of floats, ints?

Tim Peters tim_one at email.msn.com
Sat May 6 15:02:41 EDT 2000


[Jerome Chan]
> How do I find the byte length of a float, double or an int?

You don't, short of reading the source code.

> Or are all standard python float, double, ints, etc are of a fixed
> format?

A Python float is a C double.
Python doesn't have a double type.
A Python int is a C long.

Every Python object also comes with some amount of object hair, like a
refcount and a pointer to its type object ... again, you have to read the
source to get the full story.

if-you-have-to-know-your-machine-is-too-small<wink>-ly y'rs  - tim






More information about the Python-list mailing list