scarlet icon indicating copy to clipboard operation
scarlet copied to clipboard

__repr__ for everyone!

Open pmelchior opened this issue 6 years ago • 3 comments

pmelchior avatar Jun 09 '18 03:06 pmelchior

I can do this. Maybe we can add both __str__ and __repr__ methods. Should I take this up? Also, indicating the classes to make additions would be helpful.

ritzvik avatar May 04 '19 06:05 ritzvik

This would be a good issue to get started. However, as I said in #51, we're shuffling the code, so I'd hold off for a few days, but then it would be nice to get __repr__ methods. Most of our classes have too complex entries for __str__, so don't bother. Therefore, as a rule, I'd recommend that __repr__ states the class name and the size of the most relevant container object.

pmelchior avatar May 04 '19 15:05 pmelchior

This would be a good issue to get started. However, as I said in #51, we're shuffling the code, so I'd hold off for a few days, but then it would be nice to get __repr__ methods. Most of our classes have too complex entries for __str__, so don't bother. Therefore, as a rule, I'd recommend that __repr__ states the class name and the size of the most relevant container object.

Thanks for the insights. I'll get started.

ritzvik avatar May 04 '19 15:05 ritzvik