Retry: Question about FutureWarning

Erik Max Francis max at alcyone.com
Tue Aug 14 21:49:27 EDT 2007


Steven W. Orr wrote:

> M1.py:268: FutureWarning: hex/oct constants > sys.maxint will
> return positive values in Python 2.4 and up
>    StartTime   = safe_dict_get ( dic, 'starttime', 0xFFFFFFFF )
	...
> import warnings
> warnings.filterwarnings('ignore', category=FutureWarning)
> 
> My question is this: Why can the warning not be shut off by putting the
> two lines in M1 where the reference exists to 0xFFFFFFFF ?

You really don't want to shut off the warning; it means just what it says:

Python 2.3.5 (#1, Feb  8 2005, 23:36:23)
[GCC 3.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> 0xffffffff
<stdin>:1: FutureWarning: hex/oct constants > sys.maxint will return 
positive values in Python 2.4 and up
-1

Python 2.4.3 (#1, Mar 29 2006, 17:16:11)
[GCC 3.2.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> 0xffffffff
4294967295L

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
  San Jose, CA, USA && 37 20 N 121 53 W && AIM, Y!M erikmaxfrancis
   Black vinyl man with black plasticized imagination
    -- Nik Kershaw



More information about the Python-list mailing list