]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45010: Remove support of special method __div__ in unittest.mock (GH-27965)
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 26 Aug 2021 18:19:47 +0000 (21:19 +0300)
committerGitHub <noreply@github.com>
Thu, 26 Aug 2021 18:19:47 +0000 (20:19 +0200)
Doc/library/unittest.mock.rst
Lib/unittest/mock.py
Misc/NEWS.d/next/Library/2021-08-26-09-54-14.bpo-45010.Cn23bQ.rst [new file with mode: 0644]

index 2f82fded9943d85499c948c20b90d41cc90536b4..0856c3fbded08acd5c0884fadacecb9e8a8f1982 100644 (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__``
index ecf84d224fce37e5f947bea0caf29e85412762c0..8193efc7cf1257382c4d3c55217e2b53553e813e 100644 (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())
diff --git a/Misc/NEWS.d/next/Library/2021-08-26-09-54-14.bpo-45010.Cn23bQ.rst b/Misc/NEWS.d/next/Library/2021-08-26-09-54-14.bpo-45010.Cn23bQ.rst
new file mode 100644 (file)
index 0000000..bdf1bfe
--- /dev/null
@@ -0,0 +1,2 @@
+Remove support of special method ``__div__`` in :mod:`unittest.mock`. It is
+not used in Python 3.