Message404950
> Can we determine if they came from an initialized object or from object in the middle of initialization?
That would be very nice because inside __init__ is the only place where we have to deal with partly initialized objects. But I think Python does not provide a way to detect this state.
Although I would very much like having FrameSummary robust to any kind error, I acknowledge that this might not be possible.
It might be frustrating for beginners, but I think the only way to "fix" this, is by having people implement their `repr`s correctly.
The documentation currently says[1]:
> This is typically used for debugging, so it is important that the representation is information-rich and unambiguous.
It should be added that __repr__ might be used to display partly initialized objects during debugging and therefore should deal with these gracefully.
[1] https://docs.python.org/3/reference/datamodel.html#object.__repr__ |
|
Date |
User |
Action |
Args |
2021-10-25 07:41:52 | moi90 | set | recipients:
+ moi90, serhiy.storchaka, iritkatriel, kj, andrei.avk, jbw |
2021-10-25 07:41:52 | moi90 | set | messageid: <1635147712.77.0.796750414608.issue43656@roundup.psfhosted.org> |
2021-10-25 07:41:52 | moi90 | link | issue43656 messages |
2021-10-25 07:41:52 | moi90 | create | |
|