![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveSupporting << and >> operators in C extension type
From: Pedro Werneck <pedro.werneck@terra.com.br>
Date: Wed Jul 27 2005 - 21:35:22 CEST
Hi list
I'm trying to implement a new type in a C extension and it must support
Everything works perfectly with &, | and ^, but with << and >> I need
It's strange because obj.__lshift__ returns the method; when I call
I searched the Objects/ directory in the interpreter source code, but
Here is the relevant piece of my source code:
The __lshift__ method:
/* Pin.__lshift__() */
PinObject *result;
if (!PyArg_ParseTuple(args, "i", &shift))
result = PyObject_NEW(PinObject, &PinType);
Py_INCREF(result);
The part of the PyNumberMethods struct:
/* Pin number methods */
(inquiry)Pin_nonzero, /*nb_nonzero*/
...
Thanks for any help...
-- Pedro WerneckReceived on Thu Sep 29 17:11:59 2005 |