From dd48ccb1e36170138338825c7a97df3a78562c7d Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 4 Apr 2018 15:26:18 +1000 Subject: [PATCH] tests/basics: Add test for subclassing an iterable native type. --- tests/basics/subclass_native_iter.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/basics/subclass_native_iter.py diff --git a/tests/basics/subclass_native_iter.py b/tests/basics/subclass_native_iter.py new file mode 100644 index 0000000000..0f6b369ad1 --- /dev/null +++ b/tests/basics/subclass_native_iter.py @@ -0,0 +1,7 @@ +# test subclassing a native type which can be iterated over + +class mymap(map): + pass + +m = mymap(lambda x: x + 10, range(4)) +print(list(m))