[Bob Ippolito] >> ... >> Actually, should this be a FutureWarning or a DeprecationWarning?
Since it was never documented, UndocumentedBugGoingAwayError ;-) Short of that, yes, DeprecationWarning. FutureWarning is for changes in non-exceptional behavior (.e.g, if we swapped the meanings of "<" and ">" in struct format codes, that would rate a FutureWarning subclass, line InsaneFutureWarning). > OK, this behavior is implemented in revision 46537: > > (this is from ./python.exe -Wall) > > >>> import struct ... > >>> struct.pack('<B', -1) > /Users/bob/src/python/Lib/struct.py:63: DeprecationWarning: struct > integer wrapping is deprecated > return o.pack(*args) > /Users/bob/src/python/Lib/struct.py:63: DeprecationWarning: 'B' > format requires 0 <= number <= 255 > return o.pack(*args) > '\xff' We certainly don't want to see two deprecation warnings for a single deprecated behavior. I suggest eliminating the "struct integer wrapping" warning, mostly because I had no idea what it _meant_ before reading the comments in _struct.c ("wrapping" is used most often in a proxy or delegation context in Python these days). "'B' format requires 0 <= number <= 255" is perfectly clear all by itself. > ... _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com