[Python-ideas] Dunder method to make object str-like

Random832 random832 at fastmail.com
Thu Apr 7 10:22:23 EDT 2016


On Thu, Apr 7, 2016, at 10:10, M.-A. Lemburg wrote:
> I must be missing something... we already have a method for this:
> .__str__()

The point is to have a method that objects that "shouldn't" be used as
strings in some contexts *won't* have, as floats (let alone strings)
don't have __index__, even though they do have __int__.


More information about the Python-ideas mailing list