20.1. Introduction/Motivation

20.1.1. What Are Extensions?

In general, any code that you write that can be integrated or imported into another Python script can be considered an “extension.” This new code can be written in pure Python or in a compiled language like C and C++ (or Java for JPython). However, a more “strict” definition of an extension is relegated to the latter category, the topic of this chapter.

One great feature of Python is that its extensions interact with the interpreter in exactly the same way as the regular Python modules. Python was designed so that the abstraction of module import hides the underlying implementation details from the code which uses such extensions. Unless the client programmer searches the file system, ...

Get Core Python Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.