Mar-17-2017, 12:24 AM
When would str() not work? If the object doesn't have __str__, it uses __repr__, and everything has __repr__, doesn't it? You would have to explicitly override __repr__ (or __str__) to throw an error to get a class that couldn't handle str().
If you don't like the ordering str() give you, that's a problem, but it's a problem of how do you order different types. There's no objective answer for that, and whatever subjective answer you come up with could be written into a function and used with key=.
If you don't like the ordering str() give you, that's a problem, but it's a problem of how do you order different types. There's no objective answer for that, and whatever subjective answer you come up with could be written into a function and used with key=.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures