- edited description
_repr_ methods are with double underscore
At least the GRS decoders have omitted this.
Are we sure that it is not necessary to implement __str__
if one has __repr__
?
Comments (5)
-
reporter -
repo owner The goal of
__repr__
is to represent without any ambiguity the object, while the goal of__str__
is to represent it in a readable way.__str__
is not necessary, but is useful when it comes to debug the formatting of a string, because it should remove special characters. It's more a "how user will see it" that a "how it is written in the code".For instance:
str(3) : '3'
str("3") : '3'
repr(3) : '3'
repr("3") : " '3' "
Details : http://stackoverflow.com/questions/1436703/difference-between-str-and-repr-in-python
-
repo owner - changed status to resolved
Resolved issue
#43→ <<cset ec5657d90af0>>
-
reporter - changed status to open
There's still lots of places where you did this mistake! Use grep!
-
repo owner - changed status to resolved
Resolved issue
#43→ <<cset bbbdb015a450>>
- Log in to comment