Martin <martin.schroe...@nerdluecht.de> added the comment:

> 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__

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43656>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to