bpo-45010: Remove support of special method __div__ in unittest.mock (GH-27965)

This commit is contained in:
Serhiy Storchaka 2021-08-26 21:19:47 +03:00 committed by GitHub
parent 989f6a3800
commit f9cd40f5e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View file

@ -2020,7 +2020,7 @@ The full list of supported magic methods is:
* Context manager: ``__enter__``, ``__exit__``, ``__aenter__`` and ``__aexit__``
* Unary numeric methods: ``__neg__``, ``__pos__`` and ``__invert__``
* The numeric methods (including right hand and in-place variants):
``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__div__``, ``__truediv__``,
``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__truediv__``,
``__floordiv__``, ``__mod__``, ``__divmod__``, ``__lshift__``,
``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, and ``__pow__``
* Numeric conversion methods: ``__complex__``, ``__int__``, ``__float__``

View file

@ -1929,7 +1929,7 @@ magic_methods = (
)
numerics = (
"add sub mul matmul div floordiv mod lshift rshift and xor or pow truediv"
"add sub mul matmul truediv floordiv mod lshift rshift and xor or pow"
)
inplace = ' '.join('i%s' % n for n in numerics.split())
right = ' '.join('r%s' % n for n in numerics.split())

View file

@ -0,0 +1,2 @@
Remove support of special method ``__div__`` in :mod:`unittest.mock`. It is
not used in Python 3.