Merged revisions 79674 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r79674 | mark.dickinson | 2010-04-03 15:05:10 +0100 (Sat, 03 Apr 2010) | 3 lines

  Issue #8300:  Let struct.pack use __index__ to convert and pack non-integers.
  Based on a patch by Meador Inge.
........
diff --git a/Misc/NEWS b/Misc/NEWS
index a1465d7..a15fa91 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -879,6 +879,11 @@
 Extension Modules
 -----------------
 
+- Issue #8300: When passing a non-integer argument to struct.pack with any
+  integer format code, struct.pack first attempts to convert the non-integer
+  using its __index__ method.  If that method is non-existent or raises
+  TypeError it goes on to try the __int__ method, as described below.
+
 - Issue #8142: Update libffi to the 3.0.9 release.
 
 - Issue #6949: Allow the _dbm extension to be built with db 4.8.x.