Questions tagged [cpython]

The reference implementation of the Python programming language. Use this tag for questions specific to this implementation, general Python questions should just be tagged with "python".

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

In addition to CPython, there are several other production-quality Python implementations: , a JIT-compiler. , written in Java and , which is written for the Common Language Runtime. There are also several experimental implementations.

CPython is a bytecode interpreter. It has a foreign function interface with several languages including C, in which one must explicitly write bindings in a language other than Python.

See also

1358 questions
-3
votes
1 answer

How use ' '.join() in Python?

I was studying PEP8's Programming Recommendations. It was recommended to use ''.join to combine strings, but I did not understand when to do so: Should I concatenate every time that way? How useful is this? At what times are ideal to use join() to…
Bruno Campos
  • 595
  • 1
  • 7
  • 18
-3
votes
1 answer

Does everything come down to builtin objects in Python?

There are functions such as print that are embedded in CPython and there are other functions such as os.makedirs that are written in external .py files (i.e. in os.py). As far as I know, print() would call some C code that is already written inside…
Andrew
  • 1
  • 1
-3
votes
1 answer

python return from function

Is it possible to return from a function and continue executing code from just under the function. I know that may sound vague but here is an example: def sayhi(): print("hi") continue_function() #makes this function continue below in stead…
jonathan
  • 590
  • 3
  • 14
-3
votes
1 answer

Reference counting for c++ function

When i run this code, i have a problem with the memory so i think i should use PY_DECREF() in order to free the memory, but i don't know where to put it ? Any help ? I've tried to put it at the end of the code, just before returning pArgs but it…
-3
votes
1 answer

pypy how to find the file about implement list type

how to find python list implement on pypy i want read the source code bui i didn't find it any one could give a help thanks
maolingzhi
  • 681
  • 3
  • 8
  • 16
-4
votes
1 answer

Is there a way to use compiled C modules with zipimport?

When I have a python shared object file (.so) in my sys.path, I can simply do : import _ctypes And it will import python2.7/lib-dynload/_ctypes.so. However, if I use a zipfile called tmp.zip that contains : Hello/_World.so with world.so containing…
user2284570
  • 2,891
  • 3
  • 26
  • 74
-6
votes
1 answer

Calling random in secrets module

I am trying to understand how the secrets module of Python works and which modules it calls when generating random numbers. I don’t have a lot of programming experience, so please stay with me. In the secrets module, they call a specific class of…
Riemann
  • 158
  • 10
-6
votes
1 answer

explanation of C implementation python's len function

I was reading about implementation of builtin functions of python when I came across this C implementation of len function static PyObject * builtin_len(PyObject *module, PyObject *obj) /*[clinic end generated code: output=fa7a270d314dfb6c…
Sim101011
  • 305
  • 1
  • 13
1 2 3
90
91