Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!
Score of 53
1 answer
23004 views

Say I have my object layout defined as: typedef struct { PyObject_HEAD // Other stuff... } pyfoo; ...and my type definition: static PyTypeObject pyfoo_T = { PyObject_HEAD_INIT(NULL) /...
Score of 48
6 answers
91432 views

I have been trying to install Cython for Python 2.7 on my Window 7 system. In particular, I prefer everything in 64 bits. (In case you wonder, I need Cython because Cython is one of the components I ...
Score of 60
4 answers
20116 views

We've been long-time fans of Pylint. Its static analysis has become a critical part of all our Python projects and has saved tons of time chasing obscure bugs. But after upgrading from 1.3 to 1.4, ...
Score of 24
1 answer
8493 views

I have a Python project with many sub-modules that I package up with distutils. I would like to build some Python extensions in C to live in some of these sub-modules but I don't understand how to ...
Score of 7
1 answer
3918 views

I'm building a C Python extension which makes use of a "third party" library— in this case, one that I've built using a separate build process and toolchain. Call this library libplumbus....
Score of 6
1 answer
3278 views

I'm just trying to start off by creating a numpy array before I even start to write my extension. Here is a super simple program: #include <stdio.h> #include <iostream> #include "Python.h"...
Score of 50
9 answers
24280 views

I have just compiled part of my C library as an extension using Cython, as a "proof of concept". I managed to hack the code (const correctnes problems etc aside), to finally get an extension built. ...
Score of 29
2 answers
22662 views

I am attempting to write a C extension for python. With the code (below) I get the compiler warning: implicit declaration of function ‘Py_InitModule’ And it fails at run time with this error: ...
Score of 2
2 answers
11267 views

Every time I launch VS code, the Pylance server crashes 5 times in in 3 minutes, or so the output terminal says. The server stops trying to relaunch and I lose out on a handful of features as a result....
Score of 40
2 answers
43687 views

I am familiar with the AspectJ extension for the Java language. I want to know if there is such a thing for Python. Don't get me wrong, I do not mean a library but a language extension like AspectJ is ...
Score of 38
2 answers
31235 views

Short version I recently came across some Python code in which the return type for a function was specified as PyObject in the documentation. What is a PyObject? Detailed version I am not a C/C++ ...
Score of 26
3 answers
12560 views

I've written a Python module that depends on some C extensions. Those C extensions depend in turn on several compiled C libraries. I'd like to be able to distribute this module bundled with all the ...
Score of 5
5 answers
2005 views

I'm creating a C++ extension for python. It creates a module parent that contains a sub-module child. The child has one method hello(). It works fine if I call it as import parent parent.child.hello() ...
Score of 3
2 answers
9265 views

I'm trying to use scapy on win32 python2.7 I've manage to compile all the other dependencies expect this one can some help in the goal of reaching this executable ? "dnet-1.12.win32-py2.7.exe" (I ...
Score of 2
1 answer
434 views

Experimentally, I verified that when a compiled extension.pyd (or .so) and plain extension.py both exist in the same directory, the .pyd file gets imported first ; the .py is only imported if the .pyd ...

15 30 50 per page