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 belopolsky
Recipients arigo, belopolsky, bob.ippolito, fredrik_j, mark.dickinson, rhettinger, theller
Date 2008-12-10.21:28:05
SpamBayes Score 0.00019260435
Marked as misclassified No
Message-id <1228944488.14.0.360490442291.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?

For the intended purpose of giving access to raw machine arithmetics, I 
would think a C implementation would be required, but Theller's patch is 
a good start.

> One difficulty with the patch is that the original ctypes code
> contained a tp_as_number ...

This can be solved by changing the order of bases for c_<type> classes.  
See attached.

The next step would be to rewrite _NumberMixin in C.  C code can be 
limited to methods operating on known c_ types, say ll_add(x, y) to add 
two longs and hl_cast(x) to cast short to long with python code taking 
care of the dispatch.  (What's the latest on the multiple dispatch, BTW?
)
History
Date User Action Args
2008-12-10 21:28:08belopolskysetrecipients: + belopolsky, arigo, theller, rhettinger, bob.ippolito, mark.dickinson, fredrik_j
2008-12-10 21:28:08belopolskysetmessageid: <1228944488.14.0.360490442291.issue887237@psf.upfronthosting.co.za>
2008-12-10 21:28:07belopolskylinkissue887237 messages
2008-12-10 21:28:06belopolskycreate