int vs long

Troels Thomsen nejtak...
Sun Dec 16 18:28:02 EST 2007


The readFile function from the win32 package aparently really expect an 
integer :

    def inWaiting(self):
        """Returns the number of bytes waiting to be read"""
        flags, comstat = ClearCommError(self.__handle)
        return comstat.cbInQue

ReadFile(h, s.inWaiting())

My code crashes because inWaiting returns a long, not an int

Why is that different on my machine and my collegues ? Have I or he 
installed a wrong version of a package?
CPython 2.5.

Was not expecting int<->long type problems in excactly python language.
Is that because we are navigating so close to the win32 api that the types 
are more strictly enforced ?

Thx in advance
Troels







More information about the Python-list mailing list