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
16 changes: 8 additions & 8 deletions Doc/library/enum.rst
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ Data types
Using :class:`auto` with :class:`Enum` results in integers of increasing value,
starting with ``1``.

.. versionchanged:: 3.12 Added :ref:`enum-dataclass-support`
.. versionchanged:: 3.12 Added :ref:`enum-dataclass-support`.

.. method:: Enum._add_alias_

Expand Down Expand Up @@ -977,9 +977,9 @@ Utilities and decorators

*auto* can be used in place of a value. If used, the *Enum* machinery will
call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an appropriate value.
For :class:`Enum` and :class:`IntEnum` that appropriate value will be the last value plus
one; for :class:`Flag` and :class:`IntFlag` it will be the first power-of-two greater
than the highest value; for :class:`StrEnum` it will be the lower-cased version of
For :class:`Enum` and :class:`IntEnum` that appropriate value will be the highest value seen
plus one; for :class:`Flag` and :class:`IntFlag` it will be the first power-of-two greater
than the highest value seen; for :class:`StrEnum` it will be the lower-cased version of
the member's name. Care must be taken if mixing *auto()* with manually
specified values.

Expand All @@ -989,8 +989,8 @@ Utilities and decorators
* ``FIRST = auto()`` will work (auto() is replaced with ``1``);
* ``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` is
used to create the ``SECOND`` enum member;
* ``THREE = [auto(), -3]`` will *not* work (``[<auto instance>, -3]`` is used to
create the ``THREE`` enum member)
* ``THIRD = [auto(), -3]`` will *not* work (``[<auto instance>, -3]`` is used to
create the ``THIRD`` enum member)

.. versionchanged:: 3.11.1

Expand All @@ -1000,7 +1000,7 @@ Utilities and decorators
``_generate_next_value_`` can be overridden to customize the values used by
*auto*.

.. note:: in 3.13 the default ``_generate_next_value_`` will always return
.. note:: In version 3.13 the default ``_generate_next_value_`` will always return
the highest member value incremented by 1, and will fail if any
member is an incompatible type.

Expand All @@ -1010,7 +1010,7 @@ Utilities and decorators
enumerations. It allows member attributes to have the same names as members
themselves.

.. note:: the *property* and the member must be defined in separate classes;
.. note:: The *property* and the member must be defined in separate classes;
for example, the *value* and *name* attributes are defined in the
*Enum* class, and *Enum* subclasses can define members with the
names ``value`` and ``name``.
Expand Down
5 changes: 5 additions & 0 deletions Include/internal/pycore_bytesobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ extern PyObject* _PyBytes_FormatEx(
PyObject *args,
int use_bytearray);

/* Concatenate two bytes objects. Used as the sq_concat slot and by the
* specializing interpreter. Unlike PyBytes_Concat(), this returns a new
* reference rather than modifying its first argument in place. */
extern PyObject* _PyBytes_Concat(PyObject *a, PyObject *b);

extern PyObject* _PyBytes_FromHex(
PyObject *string,
int use_bytearray);
Expand Down
5 changes: 5 additions & 0 deletions Include/internal/pycore_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,11 @@ typedef struct {
aliased to either operand). Used by the tier 2 optimizer to enable
inplace follow-up ops. */
int result_unique;
/* Expected types of the left and right operands. Used by the tier 2
optimizer to eliminate _GUARD_BINARY_OP_EXTEND when the operand
types are already known. NULL means unknown/don't eliminate. */
PyTypeObject *lhs_type;
PyTypeObject *rhs_type;
} _PyBinaryOpSpecializationDescr;

/* Comparison bit masks. */
Expand Down
5 changes: 5 additions & 0 deletions Include/internal/pycore_dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ typedef struct {
extern PyDictKeysObject *_PyDict_NewKeysForClass(PyHeapTypeObject *);
extern PyObject *_PyDict_FromKeys(PyObject *, PyObject *, PyObject *);

/* Implementations of the `|` and `|=` operators for dict, used by the
* specializing interpreter. */
extern PyObject *_PyDict_Or(PyObject *self, PyObject *other);
extern PyObject *_PyDict_IOr(PyObject *self, PyObject *other);

/* Gets a version number unique to the current state of the keys of dict, if possible.
* Returns the version number, or zero if it was not possible to get a version number. */
extern uint32_t _PyDictKeys_GetVersionForCurrentState(
Expand Down
1 change: 1 addition & 0 deletions Include/internal/pycore_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extern "C" {
PyAPI_FUNC(PyObject*) _PyList_Extend(PyListObject *, PyObject *);
PyAPI_FUNC(PyObject) *_PyList_SliceSubscript(PyObject*, PyObject*);
PyAPI_FUNC(PyObject *) _PyList_BinarySlice(PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyList_Concat(PyObject *, PyObject *);
extern void _PyList_DebugMallocStats(FILE *out);
// _PyList_GetItemRef should be used only when the object is known as a list
// because it doesn't raise TypeError when the object is not a list, whereas PyList_GetItemRef does.
Expand Down
1 change: 1 addition & 0 deletions Include/internal/pycore_tuple.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ PyAPI_FUNC(void) _PyStolenTuple_Free(PyObject *self);
PyAPI_FUNC(PyObject *)_PyTuple_FromStackRefStealOnSuccess(const union _PyStackRef *, Py_ssize_t);
PyAPI_FUNC(PyObject *)_PyTuple_FromArraySteal(PyObject *const *, Py_ssize_t);
PyAPI_FUNC(PyObject *) _PyTuple_BinarySlice(PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyTuple_Concat(PyObject *, PyObject *);

PyAPI_FUNC(PyObject *) _PyTuple_FromPair(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyTuple_FromPairSteal(PyObject *, PyObject *);
Expand Down
Loading
Loading