(py_number)
| 15 | # CPython would reuse the objects for small ints in range [-5, 256] |
| 16 | # Making sure we don't do any changes on them |
| 17 | def test_cached_int_object(py_number): |
| 18 | |
| 19 | # type is still int |
| 20 | assert type(py_number) is int |
| 21 | assert not isinstance(py_number, pm.bigint) |
| 22 | test_bigint(py_number) |
| 23 | assert type(py_number) is int |
| 24 | assert not isinstance(py_number, pm.bigint) |
| 25 | # the value doesn't change |
| 26 | # TODO (Tom Tang): Find a way to create a NEW int object with the same |
| 27 | # value, because int literals also reuse the cached int objects |
| 28 | for _ in range(2): |
no test coverage detected