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
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Security Policy

Python [provides a security policy and threat model](https://devguide.python.org/security/policy/)
in the Python Development Guide documenting what bugs are vulnerabilities,
in the Python Developer's Guide documenting what bugs are vulnerabilities,
how to structure reports, and what versions of Python accept reports.

Python Security Response Team (PSRT) members
Expand Down
31 changes: 18 additions & 13 deletions Doc/library/operator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ The mathematical and bitwise operations are the most numerous:
.. function:: and_(a, b)
__and__(a, b)

Return the bitwise and of *a* and *b*.
Return ``a & b``.


.. function:: floordiv(a, b)
Expand All @@ -134,13 +134,13 @@ The mathematical and bitwise operations are the most numerous:
__inv__(obj)
__invert__(obj)

Return the bitwise inverse of the number *obj*. This is equivalent to ``~obj``.
Return ``~obj``.


.. function:: lshift(a, b)
__lshift__(a, b)

Return *a* shifted left by *b*.
Return ``a << b``.


.. function:: mod(a, b)
Expand All @@ -152,7 +152,7 @@ The mathematical and bitwise operations are the most numerous:
.. function:: mul(a, b)
__mul__(a, b)

Return ``a * b``, for *a* and *b* numbers.
Return ``a * b``.


.. function:: matmul(a, b)
Expand All @@ -172,25 +172,25 @@ The mathematical and bitwise operations are the most numerous:
.. function:: or_(a, b)
__or__(a, b)

Return the bitwise or of *a* and *b*.
Return ``a | b``.


.. function:: pos(obj)
__pos__(obj)

Return *obj* positive (``+obj``).
Return ``+obj``.


.. function:: pow(a, b)
__pow__(a, b)

Return ``a ** b``, for *a* and *b* numbers.
Return ``a ** b``.


.. function:: rshift(a, b)
__rshift__(a, b)

Return *a* shifted right by *b*.
Return ``a >> b``.


.. function:: sub(a, b)
Expand All @@ -209,7 +209,7 @@ The mathematical and bitwise operations are the most numerous:
.. function:: xor(a, b)
__xor__(a, b)

Return the bitwise exclusive or of *a* and *b*.
Return ``a ^ b``.


Operations which work with sequences (some of them with mappings too) include:
Expand Down Expand Up @@ -403,13 +403,18 @@ Python syntax and the functions in the :mod:`!operator` module.
+-----------------------+-------------------------+---------------------------------------+
| Division | ``a // b`` | ``floordiv(a, b)`` |
+-----------------------+-------------------------+---------------------------------------+
| Bitwise And | ``a & b`` | ``and_(a, b)`` |
| Bitwise And, or | ``a & b`` | ``and_(a, b)`` |
| Intersection | | |
+-----------------------+-------------------------+---------------------------------------+
| Bitwise Exclusive Or | ``a ^ b`` | ``xor(a, b)`` |
| Bitwise Exclusive Or, | ``a ^ b`` | ``xor(a, b)`` |
| or Symmetric | | |
| Difference | | |
+-----------------------+-------------------------+---------------------------------------+
| Bitwise Inversion | ``~ a`` | ``invert(a)`` |
| Bitwise Inversion, or | ``~ a`` | ``invert(a)`` |
| Complement | | |
+-----------------------+-------------------------+---------------------------------------+
| Bitwise Or | ``a | b`` | ``or_(a, b)`` |
| Bitwise Or, or | ``a | b`` | ``or_(a, b)`` |
| Union | | |
+-----------------------+-------------------------+---------------------------------------+
| Exponentiation | ``a ** b`` | ``pow(a, b)`` |
+-----------------------+-------------------------+---------------------------------------+
Expand Down
23 changes: 19 additions & 4 deletions Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2174,9 +2174,25 @@ expression support in the :mod:`re` module).
character, ``False`` otherwise. Digits include decimal characters and digits that need
special handling, such as the compatibility superscript digits.
This covers digits which cannot be used to form numbers in base 10,
like the Kharosthi numbers. Formally, a digit is a character that has the
like the `Kharosthi numbers <https://en.wikipedia.org/wiki/Kharosthi#Numerals>`__.
Formally, a digit is a character that has the
property value Numeric_Type=Digit or Numeric_Type=Decimal.

For example:

.. doctest::

>>> '0123456789'.isdigit()
True
>>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # Arabic-Indic digits zero to nine
True
>>> '⅕'.isdigit() # Vulgar fraction one fifth
False
>>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()
(False, True, True)

See also :meth:`isdecimal` and :meth:`isnumeric`.


.. method:: str.isidentifier()

Expand Down Expand Up @@ -2217,15 +2233,14 @@ expression support in the :mod:`re` module).

>>> '0123456789'.isnumeric()
True
>>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-indic digit zero to nine
>>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-Indic digits zero to nine
True
>>> '⅕'.isnumeric() # Vulgar fraction one fifth
True
>>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()
(False, True, True)

See also :meth:`isdecimal` and :meth:`isdigit`. Numeric characters are
a superset of decimal numbers.
See also :meth:`isdecimal` and :meth:`isdigit`.


.. method:: str.isprintable()
Expand Down
12 changes: 6 additions & 6 deletions Doc/reference/datamodel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2230,12 +2230,12 @@ Basic customization
pair: built-in function; hash

Called by built-in function :func:`hash` and for operations on members of
hashed collections including :class:`set`, :class:`frozenset`, and
:class:`dict`. The ``__hash__()`` method should return an integer. The only required
property is that objects which compare equal have the same hash value; it is
advised to mix together the hash values of the components of the object that
also play a part in comparison of objects by packing them into a tuple and
hashing the tuple. Example::
hashed collections including :class:`set`, :class:`frozenset`, :class:`dict`,
and :class:`frozendict`. The ``__hash__()`` method should return an integer.
The only required property is that objects which compare equal have the same
hash value; it is advised to mix together the hash values of the components
of the object that also play a part in comparison of objects by packing them
into a tuple and hashing the tuple. Example::

def __hash__(self):
return hash((self.name, self.nick, self.color))
Expand Down
2 changes: 0 additions & 2 deletions Lib/test/test_os/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -3793,7 +3793,6 @@ async def test_trailers(self):
@requires_headers_trailers
@requires_32b
async def test_headers_overflow_32bits(self):
self.server.handler_instance.accumulate = False
with self.assertRaises(OSError) as cm:
await self.async_sendfile(self.sockno, self.fileno, 0, 0,
headers=[b"x" * 2**16] * 2**15)
Expand All @@ -3802,7 +3801,6 @@ async def test_headers_overflow_32bits(self):
@requires_headers_trailers
@requires_32b
async def test_trailers_overflow_32bits(self):
self.server.handler_instance.accumulate = False
with self.assertRaises(OSError) as cm:
await self.async_sendfile(self.sockno, self.fileno, 0, 0,
trailers=[b"x" * 2**16] * 2**15)
Expand Down
Loading