[Python-Dev] Unclear on the way forward with unsigned integers (original) (raw)
Thomas Heller thomas.heller@ion-tof.com
Mon, 7 Oct 2002 22:03:56 +0200
- Previous message: [Python-Dev] Unclear on the way forward with unsigned integers
- Next message: [Python-Dev] Unclear on the way forward with unsigned integers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Mark Hammond] > While this case seems quite trivial, I am starting to face this issue > more and more, especially as I am seeing these lovely "FutureWarnings" > from all my lovely 32 bit hexadecimal constants <wink/frown>
[Tim] > Sticking "L" at the end is usually all it takes. [Thomas Heller] > That removes the warnings for 'x = 0x80000000L'. What else do you think Mark may have meant by "32 bit hexadecimal constants"? > Is there a way (other than the -w command-line arg) > to suppress the warnings when doing 'hex(-1)'? The result of that is also currently platform-dependent, so you need to say what you mean in a platform-independent way. It's likely that you meant hex(-1 & 0xffffffffL) or, more directly, hex(0xffffffffL) but that someone on a 64-bit box meant something other than that. > Shouldn't there be a future option? You seem to want most of all to avoid warning msgs, but future options don't accomplish that: it's the point of future thingies to spit out warnings about semantics that are going to change. Yes, I want to avoid the warnings.
I've reread pep237 (is this the relevant one?) again. Do I understand this correctly, that all the following expressions will be 'true' and will compile/execute without any warnings (on a 32bit box):
Python 2.2: 0x80000000 == -2147483648
Python 2.3: 0x80000000L == 2147483648
Python 2.x (Phase B1?): 0x80000000L == 2147483648
Python 2.y (Phase B2 and later): 0x80000000 == 2147483648
Regards,
Thomas
- Previous message: [Python-Dev] Unclear on the way forward with unsigned integers
- Next message: [Python-Dev] Unclear on the way forward with unsigned integers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]