@@ -162,3 +162,48 @@ The following functions provide locale-independent string to number conversions.
162162
163163 Case insensitive comparison of strings. The function works almost
164164 identically to :c:func: `!strncmp ` except that it ignores the case.
165+
166+
167+ Character classification and conversion
168+ =======================================
169+
170+ The following macros provide locale-independent character classification and
171+ conversion. The argument must be a signed or unsigned :c:type: `char `.
172+
173+ .. c :macro :: Py_ISALNUM(c)
174+
175+ Return true if the character *c * is an alphanumeric character.
176+
177+ .. c :macro :: Py_ISALPHA(c)
178+
179+ Return true if the character *c * is an alphabetic character (``a-z `` and ``A-Z ``).
180+
181+ .. c:macro:: Py_ISDIGIT(c)
182+
183+ Return true if the character *c* is a decimal digit (``0-9 ``).
184+
185+ .. c:macro:: Py_ISLOWER(c)
186+
187+ Return true if the character *c* is a lowercase ASCII letter (``a-z ``).
188+
189+ .. c:macro:: Py_ISUPPER(c)
190+
191+ Return true if the character *c* is an uppercase ASCII letter (``A-Z ``).
192+
193+ .. c:macro:: Py_ISSPACE(c)
194+
195+ Return true if the character *c* is a whitespace character (space, tab,
196+ carriage return, newline, vertical tab, or form feed).
197+
198+ .. c:macro:: Py_ISXDIGIT(c)
199+
200+ Return true if the character *c* is a hexadecimal digit (``0-9 ``, ``a-f ``, and
201+ ``A-F ``).
202+
203+ .. c:macro:: Py_TOLOWER(c)
204+
205+ Return the lowercase equivalent of the character *c*.
206+
207+ .. c:macro:: Py_TOUPPER(c)
208+
209+ Return the uppercase equivalent of the character *c*.
0 commit comments