[3.13] gh-120345: Fix incorrect use of the :class: role with the "()" suffix (GH-120347) (GH-120411)

* Remove "()" when refer to a class as a type.
* Use :func: when refer to a callable.
* Fix reference to the datetime.astimezone() method.
(cherry picked from commit 92c9c6ae14)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-06-12 16:51:35 +02:00 committed by GitHub
parent e04809299f
commit f0788cb419
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 9 additions and 9 deletions

View file

@ -1724,7 +1724,7 @@ attribute of the function object to change this::
:mod:`ctypes` also provides a wrapper for Python's C API as the
``ctypes.pythonapi`` object. This object does *not* release the global
interpreter lock before calling a function, because the lock must be held when
calling into the interpreter's code. There's a :class:`py_object()` type
calling into the interpreter's code. There's a :class:`~ctypes.py_object` type
constructor that will create a :c:expr:`PyObject *` pointer. A simple usage::
import ctypes
@ -1734,7 +1734,7 @@ constructor that will create a :c:expr:`PyObject *` pointer. A simple usage::
ctypes.py_object("abc"), ctypes.py_object(1))
# d is now {'abc', 1}.
Don't forget to use :class:`py_object()`; if it's omitted you end up with a
Don't forget to use :func:`~ctypes.py_object`; if it's omitted you end up with a
segmentation fault.
:mod:`ctypes` has been around for a while, but people still write and

View file

@ -739,7 +739,7 @@ inspect
itertools
---------
* Add :class:`itertools.batched()` for collecting into even-sized
* Add :func:`itertools.batched` for collecting into even-sized
tuples where the last batch may be shorter than the rest.
(Contributed by Raymond Hettinger in :gh:`98363`.)