Retry: Question about FutureWarning

Steven W. Orr steveo at syslang.net
Wed Aug 15 10:36:02 EDT 2007


Thanks guys, but that's not my question. The question is this: Why does 
the call to filterwarnings not work if it's placed inside the M1 module? 
Why do I have to place the call in M4 to make it work? This is more a 
question about how import works than it is about what the value of -1 is. 
;-)

On Tuesday, Aug 14th 2007 at 18:49 -0700, quoth Erik Max Francis:

=>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
=>

On Wednesday, Aug 15th 2007 at 06:10 -0700, quoth Paul McGuire:

=>On Aug 14, 8:49 pm, Erik Max Francis <m... at alcyone.com> wrote:
=>
=>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
=>
=>-- 
=>http://mail.python.org/mailman/listinfo/python-list
=>

-- 
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net



More information about the Python-list mailing list