473,395 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1510
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Logan | last post by:
I read in PEP 279 the following comment by GvR: "filter and map should die and be subsumed into list comprehensions, not grow more variants." Actually, I am using 'filter' and 'map' a lot in...
2
by: Michele Simionato | last post by:
Some time ago I hacked a custom solution to run doctests on text files containing documentation. The solution involved this kind of game: tester=doctest.Tester(globs={},verbose=1)...
3
by: Rob McCrea | last post by:
Hi all, On windows98SE, running Python 2.3.4 (#53, May 25 2004, 21:17:02) on win32, the built-in help() function gives me a deprecation warning when used on my docstrings. just help() start...
8
by: Uwe Mayer | last post by:
Hi, Why is the UserDict module is deprecated after Python 2.2. The application of it I have in mind is, i.e. multiple inheritance from "file" and "dic" - which is not possible. If I used...
3
by: Ben Rush | last post by:
When I compile my solution I get the following output - NET 2003\Vc7\atlmfc\include\atlwin.h(2027) : warning C4995: 'wsprintf': name was marked as #pragma deprecated C:\Program Files\Microsoft...
45
by: Gregory Petrosyan | last post by:
1) From 2.4.2 documentation: There are two new valid (semantic) forms for the raise statement: raise Class, instance raise instance 2) In python: >>> raise NameError Traceback (most recent...
2
bartonc
by: bartonc | last post by:
>>> import string >>> help(string) Help on module string: NAME string - A collection of string operations (most are no longer used). FILE d:\python25\lib\string.py
1
by: Szabolcs Nagy | last post by:
I've just seen that gopherlib is deprecated in python 2.5 http://docs.python.org/lib/module-gopherlib.html we still use this protocol (though there are only few working gopher servers are left...
2
by: awalter1 | last post by:
Hello, (environment : python 2.4.2, pyGTK, GTK+ 2.6.9 under HPUX 11.11: unix) On the instruction self.window.destroy(), I get the following message : lookup.py:121: GtkDeprecationWarning:...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.