Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Doc/c-api/typeobj.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2975,13 +2975,13 @@ Buffer Object Structures
steps:

(1) Check if the request can be met. If not, raise :exc:`BufferError`,
set :c:expr:`view->obj` to ``NULL`` and return ``-1``.
set ``view->obj`` to ``NULL`` and return ``-1``.

(2) Fill in the requested fields.

(3) Increment an internal counter for the number of exports.

(4) Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`.
(4) Set ``view->obj`` to *exporter* and increment ``view->obj``.

(5) Return ``0``.

Expand All @@ -3007,10 +3007,10 @@ Buffer Object Structures
schemes can be used:

* Re-export: Each member of the tree acts as the exporting object and
sets :c:expr:`view->obj` to a new reference to itself.
sets ``view->obj`` to a new reference to itself.

* Redirect: The buffer request is redirected to the root object of the
tree. Here, :c:expr:`view->obj` will be a new reference to the root
tree. Here, ``view->obj`` will be a new reference to the root
object.

The individual fields of *view* are described in section
Expand Down Expand Up @@ -3064,7 +3064,7 @@ Buffer Object Structures
*view* argument.


This function MUST NOT decrement :c:expr:`view->obj`, since that is
This function MUST NOT decrement ``view->obj``, since that is
done automatically in :c:func:`PyBuffer_Release` (this scheme is
useful for breaking reference cycles).

Expand Down
2 changes: 1 addition & 1 deletion Doc/library/bisect.rst
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ example uses :py:func:`~bisect.bisect` to look up a letter grade for an exam sco
based on a set of ordered numeric breakpoints: 90 and up is an 'A', 80 to 89 is
a 'B', and so on::

>>> def grade(score)
>>> def grade(score):
... i = bisect([60, 70, 80, 90], score)
... return "FDCBA"[i]
...
Expand Down
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
Doc/c-api/init_config.rst
Doc/c-api/intro.rst
Doc/c-api/stable.rst
Doc/c-api/typeobj.rst
Doc/library/ast.rst
Doc/library/asyncio-extending.rst
Doc/library/email.charset.rst
Expand Down
1 change: 1 addition & 0 deletions Include/internal/pycore_global_objects_fini_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Include/internal/pycore_global_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(updates)
STRUCT_FOR_ID(uri)
STRUCT_FOR_ID(usedforsecurity)
STRUCT_FOR_ID(utcoffset)
STRUCT_FOR_ID(value)
STRUCT_FOR_ID(values)
STRUCT_FOR_ID(version)
Expand Down
1 change: 1 addition & 0 deletions Include/internal/pycore_runtime_init_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Include/internal/pycore_unicodeobject_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@ get_tzinfo_member(PyObject *self)
* this returns NULL. Else result is returned.
*/
static PyObject *
call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)
call_tzinfo_method(PyObject *tzinfo, PyObject *name, PyObject *tzinfoarg)
{
PyObject *offset;

Expand All @@ -1519,7 +1519,7 @@ call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)

if (tzinfo == Py_None)
Py_RETURN_NONE;
offset = PyObject_CallMethod(tzinfo, name, "O", tzinfoarg);
offset = PyObject_CallMethodOneArg(tzinfo, name, tzinfoarg);
if (offset == Py_None || offset == NULL)
return offset;
if (PyDelta_Check(offset)) {
Expand All @@ -1536,7 +1536,7 @@ call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)
}
else {
PyErr_Format(PyExc_TypeError,
"tzinfo.%s() must return None or "
"tzinfo.%U() must return None or "
"timedelta, not '%.200s'",
name, Py_TYPE(offset)->tp_name);
Py_DECREF(offset);
Expand All @@ -1557,7 +1557,7 @@ call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)
static PyObject *
call_utcoffset(PyObject *tzinfo, PyObject *tzinfoarg)
{
return call_tzinfo_method(tzinfo, "utcoffset", tzinfoarg);
return call_tzinfo_method(tzinfo, &_Py_ID(utcoffset), tzinfoarg);
}

/* Call tzinfo.dst(tzinfoarg), and extract an integer from the
Expand All @@ -1571,7 +1571,7 @@ call_utcoffset(PyObject *tzinfo, PyObject *tzinfoarg)
static PyObject *
call_dst(PyObject *tzinfo, PyObject *tzinfoarg)
{
return call_tzinfo_method(tzinfo, "dst", tzinfoarg);
return call_tzinfo_method(tzinfo, &_Py_ID(dst), tzinfoarg);
}

/* Call tzinfo.tzname(tzinfoarg), and return the result. tzinfo must be
Expand Down
Loading