python Programming Glossary: pyobject
Simple Python Challenge: Fastest Bitwise XOR on Data Buffers http://stackoverflow.com/questions/2119761/simple-python-challenge-fastest-bitwise-xor-on-data-buffers end in1 n while in1 end out in1 ^ in2 in1 in2 out code2 PyObject res PyString_FromStringAndSize NULL real_size const ssize_t..
Find out how much memory is being used by an object in Python http://stackoverflow.com/questions/33978/find-out-how-much-memory-is-being-used-by-an-object-in-python You may also want to check some old description about PyObject the internal C struct that represents virtually all python objects..
Good way to append to a string http://stackoverflow.com/questions/4435169/good-way-to-append-to-a-string source bytesobject.c void PyBytes_ConcatAndDel register PyObject pv register PyObject w PyBytes_Concat pv w Py_XDECREF w The.. void PyBytes_ConcatAndDel register PyObject pv register PyObject w PyBytes_Concat pv w Py_XDECREF w The following function breaks.. that and a trailing 0 byte is stored. int _PyBytes_Resize PyObject pv Py_ssize_t newsize register PyObject v register PyBytesObject..
Python (and Python C API): __new__ versus __init__ http://stackoverflow.com/questions/4859129/python-and-python-c-api-new-versus-init member is initialized to an empty string like so static PyObject Noddy_new PyTypeObject type PyObject args PyObject kwds ....... string like so static PyObject Noddy_new PyTypeObject type PyObject args PyObject kwds ..... self first PyString_FromString if self.. static PyObject Noddy_new PyTypeObject type PyObject args PyObject kwds ..... self first PyString_FromString if self first NULL..
Cyclic module dependencies and relative imports in Python http://stackoverflow.com/questions/6351805/cyclic-module-dependencies-and-relative-imports-in-python the function import_from with this two arguments static PyObject import_from PyObject v PyObject name PyObject x x PyObject_GetAttr.. with this two arguments static PyObject import_from PyObject v PyObject name PyObject x x PyObject_GetAttr v name if x NULL.. this two arguments static PyObject import_from PyObject v PyObject name PyObject x x PyObject_GetAttr v name if x NULL PyErr_ExceptionMatches..
How Big can a Python Array Get? http://stackoverflow.com/questions/855191/how-big-can-a-python-array-get code the maximum size of a list is PY_SSIZE_T_MAX sizeof PyObject . PY_SSIZE_T_MAX is defined in pyport.h to be size_t 1 1 On..
Calling Python in Java? http://stackoverflow.com/questions/8898765/calling-python-in-java a function that takes a string and returns a string PyObject someFunc interpreter.get funcName PyObject result someFunc.__call__.. a string PyObject someFunc interpreter.get funcName PyObject result someFunc.__call__ new PyString Test String realResult..
How can I implement a C++ class in Python, to be called by C++? http://stackoverflow.com/questions/9040669/how-can-i-implement-a-c-class-in-python-to-be-called-by-c Python.h int main Py_Initialize const double input 5.0 PyObject main PyImport_AddModule __main__ PyObject dict PyModule_GetDict.. double input 5.0 PyObject main PyImport_AddModule __main__ PyObject dict PyModule_GetDict main PySys_SetPath . PyObject module PyImport_Import.. PyObject dict PyModule_GetDict main PySys_SetPath . PyObject module PyImport_Import PyString_FromString mycl PyModule_AddObject..
|