summaryrefslogtreecommitdiff
path: root/tests/basics/subclass_native_str.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-02-04 18:25:34 +1100
committerDamien George <damien.p.george@gmail.com>2020-02-04 18:25:34 +1100
commit69b415f7458c135375a6a37b77c5eb87b29ebb8d (patch)
treea13d4730a996fd49f33b32915ecc89a6e36fb2e8 /tests/basics/subclass_native_str.py
parentff9a61b5a82a56f5f8811815f943b575eb419790 (diff)
tests: Move CPy diff test to real test now that subclass equality works.
Testing for equality of subclassed strings now works, thanks to commit 3aab54bf434e7f025a91ea05052f1bac439fad8c
Diffstat (limited to 'tests/basics/subclass_native_str.py')
-rw-r--r--tests/basics/subclass_native_str.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basics/subclass_native_str.py b/tests/basics/subclass_native_str.py
new file mode 100644
index 000000000..32090ce27
--- /dev/null
+++ b/tests/basics/subclass_native_str.py
@@ -0,0 +1,10 @@
+# Test subclassing built-in str
+
+class S(str):
+ pass
+
+s = S('hello')
+print(s == 'hello')
+print('hello' == s)
+print(s == 'Hello')
+print('Hello' == s)