On Sat, Jul 28, 2018 at 8:07 PM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > On Sat, 28 Jul 2018 09:47:07 +0000, Gilmeh Serda wrote: > >> On Tue, 24 Jul 2018 12:33:27 -0700, Tobiah wrote: >> >>> I'm trying to get away from things like: >>> >>> >>> type(thing) is type(None) >> >> How about: >> >> >>> some_thing = None >> >>> type(some_thing).__str__(some_thing) >> 'None' >> >> Equally weird, I'd say, but what the heck... > > class Foo: > def __str__(self): > return 'None'
>>> object.__str__(some_thing) Problem solved. :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list