Skip to content

Commit

Permalink
Merge branch 'main' into pythongh-118314
Browse files Browse the repository at this point in the history
  • Loading branch information
terryjreedy committed Apr 26, 2024
2 parents 03c6675 + 3e06c7f commit d2637b7
Show file tree
Hide file tree
Showing 18 changed files with 329 additions and 150 deletions.
10 changes: 5 additions & 5 deletions Doc/library/enum.rst
Expand Up @@ -279,7 +279,7 @@ Data Types
>>> Color.RED.value
1

Value of the member, can be set in :meth:`~object.__new__`.
Value of the member, can be set in :meth:`~Enum.__new__`.

.. note:: Enum member values

Expand All @@ -299,7 +299,7 @@ Data Types

.. attribute:: Enum._value_

Value of the member, can be set in :meth:`~object.__new__`.
Value of the member, can be set in :meth:`~Enum.__new__`.

.. attribute:: Enum._order_

Expand Down Expand Up @@ -407,8 +407,8 @@ Data Types

results in the call ``int('1a', 16)`` and a value of ``17`` for the member.

..note:: When writing a custom ``__new__``, do not use ``super().__new__`` --
call the appropriate ``__new__`` instead.
.. note:: When writing a custom ``__new__``, do not use ``super().__new__`` --
call the appropriate ``__new__`` instead.

.. method:: Enum.__repr__(self)

Expand Down Expand Up @@ -827,7 +827,7 @@ Supported ``__dunder__`` names
:attr:`~EnumType.__members__` is a read-only ordered mapping of ``member_name``:``member``
items. It is only available on the class.

:meth:`~object.__new__`, if specified, must create and return the enum members;
:meth:`~Enum.__new__`, if specified, must create and return the enum members;
it is also a very good idea to set the member's :attr:`!_value_` appropriately.
Once all the members are created it is no longer used.

Expand Down
3 changes: 2 additions & 1 deletion Include/internal/pycore_opcode_metadata.h

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

207 changes: 104 additions & 103 deletions Include/internal/pycore_uop_ids.h

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

8 changes: 8 additions & 0 deletions Include/internal/pycore_uop_metadata.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/object.h
Expand Up @@ -303,7 +303,11 @@ _Py_ThreadId(void)
static inline Py_ALWAYS_INLINE int
_Py_IsOwnedByCurrentThread(PyObject *ob)
{
#ifdef _Py_THREAD_SANITIZER
return _Py_atomic_load_uintptr_relaxed(&ob->ob_tid) == _Py_ThreadId();
#else
return ob->ob_tid == _Py_ThreadId();
#endif
}
#endif

Expand Down

0 comments on commit d2637b7

Please sign in to comment.