| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,8 +17,8 @@ of Unicode characters while staying memory efficient. There are special cases | |||
| 17 | 17 | for strings where all code points are below 128, 256, or 65536; otherwise, code | |
| 18 | 18 | points must be below 1114112 (which is the full Unicode range). | |
| 19 | 19 | ||
| 20 | - :c:type:`Py_UNICODE*` and UTF-8 representations are created on demand and cached | ||
| 21 | - in the Unicode object. The :c:type:`Py_UNICODE*` representation is deprecated | ||
| 20 | + :c:expr:`Py_UNICODE*` and UTF-8 representations are created on demand and cached | ||
| 21 | + in the Unicode object. The :c:expr:`Py_UNICODE*` representation is deprecated | ||
| 22 | 22 | and inefficient. | |
| 23 | 23 | ||
| 24 | 24 | Due to the transition between the old APIs and the new APIs, Unicode objects | |
@@ -30,7 +30,7 @@ can internally be in two states depending on how they were created: | |||
| 30 | 30 | ||
| 31 | 31 | * "legacy" Unicode objects have been created through one of the deprecated | |
| 32 | 32 | APIs (typically :c:func:`PyUnicode_FromUnicode`) and only bear the | |
| 33 | - :c:type:`Py_UNICODE*` representation; you will have to call | ||
| 33 | + :c:expr:`Py_UNICODE*` representation; you will have to call | ||
| 34 | 34 | :c:func:`PyUnicode_READY` on them before calling any other API. | |
| 35 | 35 | ||
| 36 | 36 | .. note:: | |
@@ -236,7 +236,7 @@ access to internal read-only data of Unicode objects: | |||
| 236 | 236 | returned buffer is always terminated with an extra null code point. It | |
| 237 | 237 | may also contain embedded null code points, which would cause the string | |
| 238 | 238 | to be truncated when used in most C functions. The ``AS_DATA`` form | |
| 239 | - casts the pointer to :c:type:`const char *`. The *o* argument has to be | ||
| 239 | + casts the pointer to :c:expr:`const char *`. The *o* argument has to be | ||
| 240 | 240 | a Unicode object (not checked). | |
| 241 | 241 | ||
| 242 | 242 | .. versionchanged:: 3.3 | |
@@ -714,7 +714,7 @@ Extension modules can continue using them, as they will not be removed in Python | |||
| 714 | 714 | ||
| 715 | 715 | Return a read-only pointer to the Unicode object's internal | |
| 716 | 716 | :c:type:`Py_UNICODE` buffer, or ``NULL`` on error. This will create the | |
| 717 | - :c:type:`Py_UNICODE*` representation of the object if it is not yet | ||
| 717 | + :c:expr:`Py_UNICODE*` representation of the object if it is not yet | ||
| 718 | 718 | available. The buffer is always terminated with an extra null code point. | |
| 719 | 719 | Note that the resulting :c:type:`Py_UNICODE` string may also contain | |
| 720 | 720 | embedded null code points, which would cause the string to be truncated when | |
@@ -730,7 +730,7 @@ Extension modules can continue using them, as they will not be removed in Python | |||
| 730 | 730 | ||
| 731 | 731 | Like :c:func:`PyUnicode_AsUnicode`, but also saves the :c:func:`Py_UNICODE` | |
| 732 | 732 | array length (excluding the extra null terminator) in *size*. | |
| 733 | - Note that the resulting :c:type:`Py_UNICODE*` string | ||
| 733 | + Note that the resulting :c:expr:`Py_UNICODE*` string | ||
| 734 | 734 | may contain embedded null code points, which would cause the string to be | |
| 735 | 735 | truncated when used in most C functions. | |
| 736 | 736 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -234,28 +234,3 @@ | |||
| 234 | 234 | # Relative filename of the data files | |
| 235 | 235 | refcount_file = 'data/refcounts.dat' | |
| 236 | 236 | stable_abi_file = 'data/stable_abi.dat' | |
| 237 | - | ||
| 238 | - # Sphinx 2 and Sphinx 3 compatibility | ||
| 239 | - # ----------------------------------- | ||
| 240 | - | ||
| 241 | - # bpo-40204: Allow Sphinx 2 syntax in the C domain | ||
| 242 | - c_allow_pre_v3 = True | ||
| 243 | - | ||
| 244 | - # bpo-40204: Disable warnings on Sphinx 2 syntax of the C domain since the | ||
| 245 | - # documentation is built with -W (warnings treated as errors). | ||
| 246 | - c_warn_on_allowed_pre_v3 = False | ||
| 247 | - | ||
| 248 | - # Fix '!' not working with C domain when pre_v3 is enabled | ||
| 249 | - import sphinx | ||
| 250 | - | ||
| 251 | - if sphinx.version_info[:2] < (5, 3): | ||
| 252 | - from sphinx.domains.c import CXRefRole | ||
| 253 | - | ||
| 254 | - original_run = CXRefRole.run | ||
| 255 | - | ||
| 256 | - def new_run(self): | ||
| 257 | - if self.disabled: | ||
| 258 | - return super(CXRefRole, self).run() | ||
| 259 | - return original_run(self) | ||
| 260 | - | ||
| 261 | - CXRefRole.run = new_run | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -208,7 +208,7 @@ a special case, for which the new value passed to the handler is ``NULL``. | |||
| 208 | 208 | Python supports two pairs of attribute handlers; a type that supports attributes | |
| 209 | 209 | only needs to implement the functions for one pair. The difference is that one | |
| 210 | 210 | pair takes the name of the attribute as a :c:expr:`char\*`, while the other | |
| 211 | - accepts a :c:type:`PyObject\*`. Each type can use whichever pair makes more | ||
| 211 | + accepts a :c:expr:`PyObject*`. Each type can use whichever pair makes more | ||
| 212 | 212 | sense for the implementation's convenience. :: | |
| 213 | 213 | ||
| 214 | 214 | getattrfunc tp_getattr; /* char * version */ | |
@@ -219,7 +219,7 @@ sense for the implementation's convenience. :: | |||
| 219 | 219 | ||
| 220 | 220 | If accessing attributes of an object is always a simple operation (this will be | |
| 221 | 221 | explained shortly), there are generic implementations which can be used to | |
| 222 | - provide the :c:type:`PyObject\*` version of the attribute management functions. | ||
| 222 | + provide the :c:expr:`PyObject*` version of the attribute management functions. | ||
| 223 | 223 | The actual need for type-specific attribute handlers almost completely | |
| 224 | 224 | disappeared starting with Python 2.2, though there are many examples which have | |
| 225 | 225 | not been updated to use some of the new generic mechanism that is available. | |
@@ -341,7 +341,7 @@ Type-specific Attribute Management | |||
| 341 | 341 | ||
| 342 | 342 | For simplicity, only the :c:expr:`char\*` version will be demonstrated here; the | |
| 343 | 343 | type of the name parameter is the only difference between the :c:expr:`char\*` | |
| 344 | - and :c:type:`PyObject\*` flavors of the interface. This example effectively does | ||
| 344 | + and :c:expr:`PyObject*` flavors of the interface. This example effectively does | ||
| 345 | 345 | the same thing as the generic example above, but does not use the generic | |
| 346 | 346 | support added in Python 2.2. It explains how the handler functions are | |
| 347 | 347 | called, so that if you do need to extend their functionality, you'll understand | |
@@ -572,7 +572,7 @@ performance-critical objects (such as numbers). | |||
| 572 | 572 | ||
| 573 | 573 | For an object to be weakly referencable, the extension type must do two things: | |
| 574 | 574 | ||
| 575 | - #. Include a :c:type:`PyObject\*` field in the C object structure dedicated to | ||
| 575 | + #. Include a :c:expr:`PyObject*` field in the C object structure dedicated to | ||
| 576 | 576 | the weak reference mechanism. The object's constructor should leave it | |
| 577 | 577 | ``NULL`` (which is automatic when using the default | |
| 578 | 578 | :c:member:`~PyTypeObject.tp_alloc`). | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,7 +24,7 @@ The Basics | |||
| 24 | 24 | ========== | |
| 25 | 25 | ||
| 26 | 26 | The :term:`CPython` runtime sees all Python objects as variables of type | |
| 27 | - :c:type:`PyObject\*`, which serves as a "base type" for all Python objects. | ||
| 27 | + :c:expr:`PyObject*`, which serves as a "base type" for all Python objects. | ||
| 28 | 28 | The :c:type:`PyObject` structure itself only contains the object's | |
| 29 | 29 | :term:`reference count` and a pointer to the object's "type object". | |
| 30 | 30 | This is where the action is; the type object determines which (C) functions | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -411,7 +411,7 @@ that subclass, which may be defined in different module than yours. | |||
| 411 | 411 | pass | |
| 412 | 412 | ||
| 413 | 413 | For a method to get its "defining class", it must use the | |
| 414 | - :c:data:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS` | ||
| 414 | + :data:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS` | ||
| 415 | 415 | :c:type:`calling convention <PyMethodDef>` | |
| 416 | 416 | and the corresponding :c:type:`PyCMethod` signature:: | |
| 417 | 417 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,10 @@ sphinx==4.5.0 | |||
| 7 | 7 | ||
| 8 | 8 | blurb | |
| 9 | 9 | ||
| 10 | - sphinx-lint<1 | ||
| 10 | + # sphinx-lint 0.6.2 yields many default role errors due to the new regular | ||
| 11 | + # expression used for default role detection, so we don't use the version | ||
| 12 | + # until the errors are fixed. | ||
| 13 | + sphinx-lint<1,!=0.6.2 | ||
| 11 | 14 | ||
| 12 | 15 | # The theme used by the documentation is stored separately, so we need | |
| 13 | 16 | # to install that as well. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1102,7 +1102,7 @@ code, none of the changes described here will affect you very much. | |||
| 1102 | 1102 | * A different argument parsing function, :c:func:`PyArg_UnpackTuple`, has been | |
| 1103 | 1103 | added that's simpler and presumably faster. Instead of specifying a format | |
| 1104 | 1104 | string, the caller simply gives the minimum and maximum number of arguments | |
| 1105 | - expected, and a set of pointers to :c:type:`PyObject\*` variables that will be | ||
| 1105 | + expected, and a set of pointers to :c:expr:`PyObject*` variables that will be | ||
| 1106 | 1106 | filled in with argument values. | |
| 1107 | 1107 | ||
| 1108 | 1108 | * Two new flags :const:`METH_NOARGS` and :const:`METH_O` are available in method | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1725,7 +1725,7 @@ attribute of the function object to change this:: | |||
| 1725 | 1725 | ``ctypes.pythonapi`` object. This object does *not* release the global | |
| 1726 | 1726 | interpreter lock before calling a function, because the lock must be held when | |
| 1727 | 1727 | calling into the interpreter's code. There's a :class:`py_object()` type | |
| 1728 | - constructor that will create a :c:type:`PyObject \*` pointer. A simple usage:: | ||
| 1728 | + constructor that will create a :c:expr:`PyObject *` pointer. A simple usage:: | ||
| 1729 | 1729 | ||
| 1730 | 1730 | import ctypes | |
| 1731 | 1731 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments