Skip to content

Commit ec0eb47

Browse files
committed
Add snippet to check that int.__init__ doesn't mutate int.
1 parent 76344e5 commit ec0eb47

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/snippets/numbers.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
x = 5
2+
x.__init__(6)
3+
assert x == 5
4+
5+
class A(int):
6+
pass
7+
8+
x = A(7)
9+
assert x == 7
10+
assert type(x) is A

0 commit comments

Comments
 (0)