PEP 399: Resolve uses of the default role (#3390)

This commit is contained in:
Adam Turner 2023-09-01 20:26:13 +01:00 committed by GitHub
parent 72cafd1859
commit 3bc3ad8f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -161,9 +161,9 @@ could be added.
To also help with compatibility, C code should use abstract APIs on
objects to prevent accidental dependence on specific types. For
instance, if a function accepts a sequence then the C code should
default to using `PyObject_GetItem()` instead of something like
`PyList_GetItem()`. C code is allowed to have a fast path if the
proper `PyList_CheckExact()` is used, but otherwise APIs should work
default to using ``PyObject_GetItem()`` instead of something like
``PyList_GetItem()``. C code is allowed to have a fast path if the
proper ``PyList_CheckExact()`` is used, but otherwise APIs should work
with any object that duck types to the proper interface instead of a
specific type.