Skip to content

Commit 1c323ac

Browse files
committed
Intermediate changes
commit_hash:d453d88ab4310a06bd5760d4862918f509e082ce
1 parent 5d2a514 commit 1c323ac

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
The Python C API
2+
================
3+
4+
The C API is divided into these sections:
5+
6+
1. ``Include/``: Limited API
7+
2. ``Include/cpython/``: CPython implementation details
8+
3. ``Include/cpython/``, names with the ``PyUnstable_`` prefix: API that can
9+
change between minor releases
10+
4. ``Include/internal/``, and any name with ``_`` prefix: The internal API
11+
12+
Information on changing the C API is available `in the developer guide`_
13+
14+
.. _in the developer guide: https://devguide.python.org/c-api/
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
bits shared by the bytesobject and unicodeobject implementations (and
2+
possibly other modules, in a not too distant future).
3+
4+
the stuff in here is included into relevant places; see the individual
5+
source files for details.
6+
7+
--------------------------------------------------------------------
8+
the following defines used by the different modules:
9+
10+
STRINGLIB_CHAR
11+
12+
the type used to hold a character (char or Py_UNICODE)
13+
14+
STRINGLIB_GET_EMPTY()
15+
16+
returns a PyObject representing the empty string, only to be used if
17+
STRINGLIB_MUTABLE is 0. It must not be NULL.
18+
19+
Py_ssize_t STRINGLIB_LEN(PyObject*)
20+
21+
returns the length of the given string object (which must be of the
22+
right type)
23+
24+
PyObject* STRINGLIB_NEW(STRINGLIB_CHAR*, Py_ssize_t)
25+
26+
creates a new string object
27+
28+
STRINGLIB_CHAR* STRINGLIB_STR(PyObject*)
29+
30+
returns the pointer to the character data for the given string
31+
object (which must be of the right type)
32+
33+
int STRINGLIB_CHECK_EXACT(PyObject *)
34+
35+
returns true if the object is an instance of our type, not a subclass
36+
37+
STRINGLIB_MUTABLE
38+
39+
must be 0 or 1 to tell the cpp macros in stringlib code if the object
40+
being operated on is mutable or not

contrib/tools/python3/Programs/README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Source files for binary executables (as opposed to shared modules)

0 commit comments

Comments
 (0)