469,271 Members | 1,759 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

deprecated python 2.5

DeprecationWarning: struct integer overflow masking is deprecated
return struct.pack('>H', ~value)
i didn't understand if someone have some explanation
and what uses instead.
Sep 12 '06 #1
1 1428
bussiere maillist wrote:
DeprecationWarning: struct integer overflow masking is deprecated
return struct.pack('>H', ~value)
i didn't understand if someone have some explanation
and what uses instead.
Which 2.5 are you using? Mine (2.5c1, win32) gives me *TWO* messages,
the second of which hints at the obvious remedy:

| DOS prompt>\python25\python
| Python 2.5c1 (r25c1:51305, Aug 17 2006, 10:41:11) [MSC v.1310 32 bit
(Intel)] on
| win32
| Type "help", "copyright", "credits" or "license" for more
information.
| >>import struct
| >>struct.pack('>H', 1)
| '\x00\x01'
| >>struct.pack('>H', ~1)
| __main__:1: DeprecationWarning: struct integer overflow masking is
deprecated
| __main__:1: DeprecationWarning: 'H' format requires 0 <= number <=
65535
| '\xff\xfe'
| >>^Z
|
| DOS prompt>\python25\python
| Python 2.5c1 (r25c1:51305, Aug 17 2006, 10:41:11) [MSC v.1310 32 bit
(Intel)] on
| win32
| Type "help", "copyright", "credits" or "license" for more
information.
| >>import struct
| >>struct.pack('>H', (~1) & 0xffff)
| '\xff\xfe'
| >>>

HTH,
John

Sep 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Logan | last post: by
2 posts views Thread by Michele Simionato | last post: by
3 posts views Thread by Rob McCrea | last post: by
8 posts views Thread by Uwe Mayer | last post: by
3 posts views Thread by Ben Rush | last post: by
45 posts views Thread by Gregory Petrosyan | last post: by
1 post views Thread by Szabolcs Nagy | last post: by
2 posts views Thread by awalter1 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.