tests: Move CPy diff test to real test now that subclass equality works.
Testing for equality of subclassed strings now works, thanks to commit
3aab54bf43
This commit is contained in:
parent
ff9a61b5a8
commit
69b415f745
|
@ -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)
|
|
@ -1,11 +0,0 @@
|
||||||
"""
|
|
||||||
categories: Types,str
|
|
||||||
description: Instance of a subclass of str cannot be compared for equality with an instance of a str
|
|
||||||
cause: Unknown
|
|
||||||
workaround: Unknown
|
|
||||||
"""
|
|
||||||
class S(str):
|
|
||||||
pass
|
|
||||||
|
|
||||||
s = S('hello')
|
|
||||||
print(s == 'hello')
|
|
Loading…
Reference in New Issue