Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(9)

Unified Diff: Lib/test/test_enumerate.py

Issue 25958: Implicit ABCs have no means of "anti-registration"
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
--- a/Lib/test/test_enumerate.py Thu Jan 07 10:58:20 2016 -0800
+++ b/Lib/test/test_enumerate.py Thu Jan 07 12:55:43 2016 -0800
@@ -232,6 +232,13 @@
ngi = NoGetItem()
self.assertRaises(TypeError, reversed, ngi)
+ class Blocked(object):
+ def __getitem__(self): return 1
Martin Panter 2016/01/09 02:34:57 Please fix or remove the signature. You can also f
abarnert 2016/01/18 20:28:42 Well, removing it would defeat the entire purpose
+ def __len__(self): return 2
+ __reversed__ = None
+ b = Blocked()
+ self.assertRaises(TypeError, reversed, b)
+
def test_pickle(self):
for data in 'abc', range(5), tuple(enumerate('abc')), range(1,17,5):
self.check_pickle(reversed(data), list(data)[::-1])

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+