(self, state: Optional[InstanceState[_O]] = None)
| 491 | # InstanceState management |
| 492 | |
| 493 | def new_instance(self, state: Optional[InstanceState[_O]] = None) -> _O: |
| 494 | # here, we would prefer _O to be bound to "object" |
| 495 | # so that mypy sees that __new__ is present. currently |
| 496 | # it's bound to Any as there were other problems not having |
| 497 | # it that way but these can be revisited |
| 498 | instance = self.class_.__new__(self.class_) |
| 499 | if state is None: |
| 500 | state = self._state_constructor(instance, self) |
| 501 | self._state_setter(instance, state) |
| 502 | return instance |
| 503 | |
| 504 | def setup_instance( |
| 505 | self, instance: _O, state: Optional[InstanceState[_O]] = None |
no test coverage detected