https://github.com/paulross/pythonextensionpatterns
Examples of safe coding practice for Python C extensions.
https://github.com/paulross/pythonextensionpatterns
c python python-c-api python-extension
Last synced: about 2 months ago
JSON representation
Examples of safe coding practice for Python C extensions.
- Host: GitHub
- URL: https://github.com/paulross/pythonextensionpatterns
- Owner: paulross
- License: mit
- Created: 2014-08-28T10:13:21.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2025-04-01T13:07:04.000Z (3 months ago)
- Last Synced: 2025-04-19T02:21:11.530Z (2 months ago)
- Topics: c, python, python-c-api, python-extension
- Language: C
- Size: 9.15 MB
- Stars: 230
- Watchers: 13
- Forks: 33
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
***************************
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 `_