Beginner: Data type conversion question

Terry Reedy tjreedy at udel.edu
Fri Jan 16 20:34:49 EST 2009


flagg wrote:

>> If rdate.serial is already a string, as name would imply, the str() call
>> is pointless.  If not, can you get inc as int more directly?
...
> Actually when i run a type(serial) on that variable it returns a
> "long" 

Then inc = serial % 100 is 'more directly'.

> which i am not sure why dnspython uses a long variable to
> store the serial.

Perhaps a holdever from C code where long is necessary to dependably 
hold counts with 8 decimal digits.




More information about the Python-list mailing list