(cls, filename)
| 2040 | x: int |
| 2041 | @classmethod |
| 2042 | def from_file(cls, filename): |
| 2043 | # In a real example, create a new instance |
| 2044 | # and populate 'x' from contents of a file. |
| 2045 | value_in_file = 20 |
| 2046 | return cls(value_in_file) |
| 2047 | |
| 2048 | self.assertEqual(C.from_file('filename').x, 20) |
| 2049 |