mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Add snippet to check that int.__init__ doesn't mutate int.
This commit is contained in:
1 parent
76344e5023
commit
ec0eb47fc6
1 file changed
+10
@@ -0,0 +1,10 @@
|
||||
x = 5
|
||||
x.__init__(6)
|
||||
assert x == 5
|
||||
|
||||
class A(int):
|
||||
pass
|
||||
|
||||
x = A(7)
|
||||
assert x == 7
|
||||
assert type(x) is A
|
||||
Reference in new issue
Block a user