Eric Wilhelm <ewilhelm at sbcglobal.net>: > + if ((obj->ob_type->tp_flags & Py_TPFLAGS_HEAPTYPE) || > PyInstance_Check(obj)) { I don't understand why you need to make this check. Aren't you going to have to check individually anyway for all the types you want to treat specially? If so, why not just if (PyString_CheckExact(obj)) { /* convert it to a Perl string */ } elif (PyInt_CheckExact(obj)) { /* convert it to a Perl integer */ } ... else { /* None of the above, wrap it generically */ } Using the CheckExact macros will ensure that you don't pick up any subclasses of the built-in types. Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg at cosc.canterbury.ac.nz +--------------------------------------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4