| 491 | self.assertEqual(pprint.pformat(1234567, underscore_numbers=True), '1_234_567') |
| 492 | |
| 493 | class Temperature(int): |
| 494 | def __new__(cls, celsius_degrees): |
| 495 | return super().__new__(Temperature, celsius_degrees) |
| 496 | def __repr__(self): |
| 497 | kelvin_degrees = self + 273.15 |
| 498 | return f"{kelvin_degrees:.2f}°K" |
| 499 | self.assertEqual(pprint.pformat(Temperature(1000)), '1273.15°K') |
| 500 | |
| 501 | def test_sorted_dict(self): |
no outgoing calls
searching dependent graphs…