Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

> 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?
)

----------
nosy: +belopolsky

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue887237>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to