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

__builtin__.iterator Does Not Exist?

Consider: Python 2.7.3 (default, Aug 2 2012, 16:55:39) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on… Read more __builtin__.iterator Does Not Exist?

Forcing Modules To Run In Pypy From A Cpython Script (run Pypy On Part Of The Code)?

Is there a way to import modules from a CPython script, but run them in PyPy? The problem is that I… Read more Forcing Modules To Run In Pypy From A Cpython Script (run Pypy On Part Of The Code)?

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

Why Is 'new_file += Line + String' So Much Faster Than 'new_file = New_file + Line + String'?

Our code takes 10 minutes to siphon thru 68,000 records when we use: new_file = new_file + line + s… Read more Why Is 'new_file += Line + String' So Much Faster Than 'new_file = New_file + Line + String'?

In Python 2.7 Why Are Strings Written Faster In Text Mode Than In Binary Mode?

The following example script writes some strings to a file using either 'w', text, or '… Read more In Python 2.7 Why Are Strings Written Faster In Text Mode Than In Binary Mode?

Default __str__ Method For An Instance

I have a class without a str or repr method. And when I call it: >>> from ingest.tpr impor… Read more Default __str__ Method For An Instance

How To Create The Int 1 At Two Different Memory Locations?

I want to show someone how using is instead of == to compare integers can fail. I thought this wou… Read more How To Create The Int 1 At Two Different Memory Locations?

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?