On Mon, May 31, 2021 at 9:12 PM David Mertz <me...@gnosis.cx> wrote: > >>> foo = "bar" > >>> eval(repr(foo)) == eval(repr(eval(repr(foo)))) > True > >>> eval(repr(None)) == eval(repr(eval(repr(None)))) > True > > Let's change the behavior of the Ellipsis object slightly to have either a > .__call__() or .__getitem__() method that returns itself, no matter what > argument is passed. > > >>> repr(...) > ...[Ellipsis] > ...(Ellipsis) > > I don't know which looks better, but neither look terrible to me. That > would produce a more explanatory repr() while also preserving idempotence. >
Oh... just in case I wasn't clear, `Ellipsis.__repr__()` would obviously need to be changed slightly as well along with adding .__call__() or .__getitem__() for this to work. -- The dead increasingly dominate and strangle both the living and the not-yet born. Vampiric capital and undead corporate persons abuse the lives and control the thoughts of homo faber. Ideas, once born, become abortifacients against new conceptions.
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/JMWS2FRMSMF6S6J2BJZ6ZSRUHSMJIZKK/ Code of Conduct: http://python.org/psf/codeofconduct/