CPython is the default and most widely used implementation of the Python programming language. It is written in C.

learn more…| top users | synonyms

0
votes
2answers
18 views

Python OpenSSL C extension: undefined symbol: AES_set_encrypt_key

I am trying to write to a OpenSSL C extension for Python. The shared library(*.so file) is generated but I am running into undefined symbol errors when importing the module. It throws the following ...
4
votes
1answer
128 views

Should importlib.reload restore a deleted attribute in Python 3.6?

I'm looking into these two related questions: here and here.I am seeing a behavior I do not expect in Python 3.6, which differs from behavior using plain reload in Python 2.7 (and 3.4). Namely, it ...
0
votes
0answers
8 views

Distributing a Python package with a distribution-specific shared library dependency

Suppose I want to distribute a CPython package, that contains bindings for a shared library (on Linux). The shared library comes from a package that is installed by OS's package manager (for example ...
1
vote
0answers
100 views

What determines the id (memory address) of None and can it change? [duplicate]

I've noticed that id(None) gives different results on different machines, but is there any chance the id of None would ever change on a single machine? I understand what id does, but I'm wondering how ...
1
vote
1answer
49 views

Do Python Implementation use Cache Oblivious Data Structures?

I was reading an article on the benefits of cache oblivious data structures and found myself wondering if the Python implementations (CPython) use this approach? If not, is there a technical ...
2
votes
2answers
26 views

Incref of params to PyEval_EvalCode depending on script

In the following MCVE two different scripts get executed. Both don't do anything special, the first one has an empty function, the second script does literally nothing. But depending on the script ...
3
votes
3answers
113 views

ln2 const value in _math.c in cpython

I'm looking at _math.c in git (line 25):#if !defined(HAVE_ACOSH) || !defined(HAVE_ASINH)static const double ln2=6.93147180559945286227E-01;static const double two_pow_p28=268435456.0; /* 2**28 ...
-2
votes
0answers
21 views

Which SRILM python library is best to use?

I have tried SRILM official library. Lack of online help/documentation led me to find other GitHub repositories. I came across pysrilm. After following necessary steps for installing. While importing ...
0
votes
1answer
38 views

Is type a 'builtin-function' or 'class' in python

I'm looking at the python documentation and came across 'type()' under the built-in-functions section. https://docs.python.org/3/library/functions.htmlHowever, when I look at the actual details, I ...
1
vote
1answer
21 views

How is everything happened when a class's metaclass is a subclass of its subclass's metaclass?

It is about metaclasses in Python2.7.To be clear, the code is like:class MetaC(type):def __new__(cls, name, bases, attrs):print "MetaC"return super(MetaC, cls).__new__(cls, ...
0
votes
0answers
30 views

SqlAlchemy logging “SystemError: error return without exception set”

I'm currently developing a web-app which uses a combination of SqlAlchemy Flask and Marshmallow to serialise Sqlite data into JSON for the front-end. I've used this setup in multiple occasions which ...
0
votes
0answers
52 views

FunctionType: why constructed function differs from original? [duplicate]

Say I have a simple function like:>>> def something(value):... return value + 2so, using types.FunctionType I can build its copy:>>> new_function=FunctionType(something....
0
votes
2answers
59 views

Difference between Python object reference and variables in cases of mutable and immutable objects

I was reading a book on python:Once we have some data types, the next thing we need are variables in whichto store them. Python doesn’t have variables as such, but instead has object...
4
votes
2answers
74 views

is operator not working on objects with same identity? [duplicate]

I'm running:Python 2.7.8 (default, Oct 6 2017, 09:25:50)[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2As per the docs:The operators is and is not test for object identity: x is y is True ...
0
votes
0answers
13 views

Creating TZInfo objects in cpython

I'm currently working with the cpython datetime api attempting to write pybind11 bindings for Howard Hinnant's date library zoned_time objects and to do so I must perform bidirectional conversions ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,