Retry: Question about FutureWarning

Paul McGuire ptmcg at austin.rr.com
Wed Aug 15 09:10:59 EDT 2007


On Aug 14, 8:49 pm, Erik Max Francis <m... at alcyone.com> wrote:
> 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 && m... 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

So if by '0xFFFFFFFF' you meant -1, then change this line to use -1.
Otherwise, if you really meant 4294967295L, leave it at 0xFFFFFFFF and
move on.

-- Paul




More information about the Python-list mailing list