From ec0eb47fc6c63e745ffc964f190cd0a042a56400 Mon Sep 17 00:00:00 2001 From: Adam Kelly Date: Sun, 2 Sep 2018 10:59:42 +0100 Subject: [PATCH] Add snippet to check that int.__init__ doesn't mutate int. --- tests/snippets/numbers.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/snippets/numbers.py diff --git a/tests/snippets/numbers.py b/tests/snippets/numbers.py new file mode 100644 index 000000000..eae26b102 --- /dev/null +++ b/tests/snippets/numbers.py @@ -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