Skip to content Skip to sidebar Skip to footer
Showing posts with the label Cpython

Cpython String Addition Optimisation Failure Case

The Question Why, in CPython, does def add_string(n): s = '' for _ in range(n): … Read more Cpython String Addition Optimisation Failure Case

How To Call A C-api Function Such As Pyunicode_read_char From Cython?

I'm using Cython to speed up a function that operates over a string (unicode, CPython 3.6). How… Read more How To Call A C-api Function Such As Pyunicode_read_char From Cython?

Storing Python Objects In A Python List Vs. A Fixed-length Numpy Array

In doing some bioinformatics work, I've been pondering the ramifications of storing object inst… Read more Storing Python Objects In A Python List Vs. A Fixed-length Numpy Array

What Does __flags__ In Python Type Used For

I have been read pickle source code recently. The following code in copy_reg make me confused: _HEA… Read more What Does __flags__ In Python Type Used For

Undefined Symbol: Pyos_mystrnicmp

I tried installing pysqlite, but I'm having some trouble using it. >>> import pysqlite… Read more Undefined Symbol: Pyos_mystrnicmp

Value Of Py_none

It is clear to me that None is used to signify the lack of a value. But since everything must have … Read more Value Of Py_none

Error When Compiling Cpython: Cannot Convert From Pylongobject To Pyobject

I've been trying to learn to use CPython and for it, I tried creating a simple factorial functi… Read more Error When Compiling Cpython: Cannot Convert From Pylongobject To Pyobject

Python: Equality For Nan In A List?

I just want to figure out the logic behind these results: >>>nan = float('nan') &g… Read more Python: Equality For Nan In A List?

Backward Compatibility Of Python 3.5 For External Modules

I have built a Python C++ module based on Python 3.4.3. Later I have installed Python 3.5, and trie… Read more Backward Compatibility Of Python 3.5 For External Modules

What Does __flags__ In Python Type Used For

I have been read pickle source code recently. The following code in copy_reg make me confused: _HEA… Read more What Does __flags__ In Python Type Used For

In C Python, Accessing The Bytecode Evaluation Stack

Given a C Python frame pointer, how do I look at arbitrary evaluation stack entries? (Some specific… Read more In C Python, Accessing The Bytecode Evaluation Stack

CPython's Static Object Address And Fragmentation

I read For CPython, id(x) is the memory address where x is stored. And it's a given the id o… Read more CPython's Static Object Address And Fragmentation