Closed sanoke closed 8 years ago
__repr__() and __str__() can be rewritten using reprlib.repr(), so that we don't have to manually check the length of our object.
__repr__()
__str__()
reprlib.repr()
reprlib
Sentence
Sequences
__repr__()
and__str__()
can be rewritten usingreprlib.repr()
, so that we don't have to manually check the length of our object.reprlib
automatically truncates long text!Sentence
class in October 03 lecture notes for an example (Sequences
Python notebook).