GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - paulross/PythonExtensionPatterns: Examples of safe coding practice for Python C extensions.

BranchesTags
Open more actions menu

Latest commit

 

History

524 Commits
524 Commits

Folders and files

NameName
Last commit message
Last commit date
PythonExtensionPatterns
PythonExtensionPatterns
 
 
doc
doc
 
 
src
src
 
 
tests/unit
tests/unit
 
 
type_objects
type_objects
 
 
.gitignore
.gitignore
 
 
.project
.project
 
 
.pydevproject
.pydevproject
 
 
.readthedocs.yaml
.readthedocs.yaml
 
 
CMakeLists.txt
CMakeLists.txt
 
 
HISTORY.rst
HISTORY.rst
 
 
INSTALL.rst
INSTALL.rst
 
 
LICENSE.txt
LICENSE.txt
 
 
MANIFEST.in
MANIFEST.in
 
 
README.rst
README.rst
 
 
build_all.sh
build_all.sh
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

PythonExtensionPatterns

If you need to write C extension for Python then this is the place for you.

The full documentation is on Read the Docs.

Code examples and documentation source are on GitHub. The example and test code is available on PyPi.

Subjects Covered

  • Introduction
  • A Simple Example
  • PyObjects and Reference Counting
  • Containers and Reference Counts
  • Struct Sequence Objects (a namedtuple in C)
  • Exception Raising
  • A Pythonic Coding Pattern for C Functions
  • Parsing Python Arguments
  • Creating New Types
  • Setting and Getting Module Globals
  • Logging and Frames
  • File Paths and Files
  • Subclassing and Using super()
  • Capsules
  • Iterators and Generators
  • Context Managers
  • Pickling C Extension Types
  • Watchers [Python 3.12+]
  • Setting Compiler Flags
  • Debugging
  • Memory Leaks
  • Thread Safety
  • Source Code Layout
  • Using C++ With CPython Code
  • Miscellaneous
  • Installation
  • Further Reading
  • TODO
  • History
  • Index

Project Links

  • Source is on GitHub.
  • Documentation on Read the Docs.
  • Project is on PyPi.

Videos

I have presented some of this, well mostly the chapter "PyObjects and Reference Counting", at Python conferences so if you prefer videos they are here:

  • PyCon UK 2015
  • PyCon US 2016

About

Examples of safe coding practice for Python C extensions.

Topics

cpythonpython-c-apipython-extension

Resources

Readme
MIT license
Activity

Stars

233 stars

Watchers

12 watching

Forks

32 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.