Are repr
and str
identical on Pythons built-in numeric types (int
, bool
, float
, and complex
), or are there (esoteric?) situations where the two may yield different results?
Related questions on SO (such as this one) focus on how __repr__
and __str__
may be implemented differently, and return different values for strings, but I can't find anything on the actual implementation on numbers.