diff options
author | blhsing <github@ydooby.com> | 2019-09-11 14:28:06 (GMT) |
---|---|---|
committer | Michael Foord <voidspace@users.noreply.github.com> | 2019-09-11 14:28:06 (GMT) |
commit | 72c359912d36705a94fca8b63d80451905a14ae4 (patch) | |
tree | 9bc21f98a2253115e39e1e776ab1f0f4c2902526 /Misc/NEWS.d/next/Library | |
parent | 1abf54336fd2cb545c453d22dd5501392b3350b2 (diff) | |
download | cpython-72c359912d36705a94fca8b63d80451905a14ae4.zip cpython-72c359912d36705a94fca8b63d80451905a14ae4.tar.gz cpython-72c359912d36705a94fca8b63d80451905a14ae4.tar.bz2 |
bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable (GH-15565)
* bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable
* 📜🤖 Added by blurb_it.
* Update 2019-08-28-21-40-12.bpo-37972.kP-n4L.rst
added name of the contributor
* bpo-37972: made all dunder methods chainable for _Call
* bpo-37972: delegate only attributes of tuple instead to __getattr__
Diffstat (limited to 'Misc/NEWS.d/next/Library')
-rw-r--r-- | Misc/NEWS.d/next/Library/2019-08-28-21-40-12.bpo-37972.kP-n4L.rst | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-08-28-21-40-12.bpo-37972.kP-n4L.rst b/Misc/NEWS.d/next/Library/2019-08-28-21-40-12.bpo-37972.kP-n4L.rst new file mode 100644 index 0000000..73d9ef7 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-08-28-21-40-12.bpo-37972.kP-n4L.rst @@ -0,0 +1,5 @@ +Subscripts to the `unittest.mock.call` objects now receive the same chaining mechanism as any other custom attributes, so that the following usage no longer raises a `TypeError`:
+
+ call().foo().__getitem__('bar')
+
+Patch by blhsing
|