This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author theller
Recipients arigo, bob.ippolito, fredrik_j, mark.dickinson, rhettinger, theller
Date 2008-11-15.18:28:04
SpamBayes Score 5.7628137e-07
Marked as misclassified No
Message-id <1226773689.19.0.864786710107.issue887237@psf.upfronthosting.co.za>
In-reply-to
Content
I wonder if a patch for ctypes like this (which is not yet complete)
could be used to implement this, or MUST it be implemented in C?

The patch contains a mixin class that implements the numeric methods. 
However, the actual operation takes place in Python; only the operands
are converted into ctypes types first, the operand is applied to the
value, and the result is converted to a ctypes instance again.

One difficulty with the patch is that the original ctypes code contained
a tp_as_number member where only the nb_nonzero slot was actually
implemented; this prevented the mixin class to do it's work (Python
didn't call the special methods.  I wonder if there is a bug somewhere...).
History
Date User Action Args
2008-11-15 18:28:10thellersetrecipients: + theller, arigo, rhettinger, bob.ippolito, mark.dickinson, fredrik_j
2008-11-15 18:28:09thellersetmessageid: <1226773689.19.0.864786710107.issue887237@psf.upfronthosting.co.za>
2008-11-15 18:28:08thellerlinkissue887237 messages
2008-11-15 18:28:07thellercreate