Added q/Q standard (x-platform 8-byte ints) mode in struct module.
This completes the q/Q project.
longobject.c _PyLong_AsByteArray: The original code had a gross bug:
the most-significant Python digit doesn't necessarily have SHIFT
significant bits, and you really need to count how many copies of the sign
bit it has else spurious overflow errors result.
test_struct.py: This now does exhaustive std q/Q testing at, and on both
sides of, all relevant power-of-2 boundaries, both positive and negative.
NEWS: Added brief dict news while I was at it.
diff --git a/Misc/NEWS b/Misc/NEWS
index 18a87e9..16850aa 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -84,6 +84,9 @@
sortdict(dict) function for a simple way to display a dict in sorted
order.
+- Many other small changes to dicts were made, resulting in faster
+ operation along the most common code paths.
+
- Dictionary objects now support the "in" operator: "x in dict" means
the same as dict.has_key(x).
@@ -119,7 +122,7 @@
- Collisions in dicts are resolved via a new approach, which can help
dramatically in bad cases. For example, looking up every key in a dict
- d with d.keys() = [i << 16 for i in range(20000)] is approximately 500x
+ d with d.keys() == [i << 16 for i in range(20000)] is approximately 500x
faster now. Thanks to Christian Tismer for pointing out the cause and
the nature of an effective cure (last December! better late than never).
@@ -145,8 +148,8 @@
native mode, these can be used only when the platform C compiler supports
these types (when HAVE_LONG_LONG is #define'd by the Python config
process), and then they inherit the sizes and alignments of the C types.
- XXX TODO In standard mode, 'q' and 'Q' are supported on all platforms, and
- XXX TODO are 8-byte integral types.
+ In standard mode, 'q' and 'Q' are supported on all platforms, and are
+ 8-byte integral types.
Tests