Skip to content

Conversation

@moi90
Copy link
Contributor

@moi90 moi90 commented Mar 29, 2021

try:
return repr(x)
except Exception as exc:
return "[Unrepresentable: {}]".format(exc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if exc is also not representable ?

@moi90
Copy link
Contributor Author

moi90 commented Mar 30, 2021

https://bugs.python.org/issue39228

As is true for most special methods, it is a bug for repr methods to raise.

I therefore retract the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants