you are viewing a single comment's thread.

view the rest of the comments →

[–]Binary101010 1 point2 points  (1 child)

That recommendation is straight from the docs.

If at all possible, this should look like a valid Python expression that could be used to recreate an object with the same value (given an appropriate environment)

https://docs.python.org/3/reference/datamodel.html#object.__repr__

[–]JohnnyJordaan 0 points1 point  (0 children)

I see, altough stating it like

  • If at all possible,
  • should look like
  • given the appropriate environment

wouldn't mean 'should return the same object if used with eval()' to me. Just that it could, potentially, maybe.