On Fri, 30 Sep 2016 05:58 am, Random832 wrote: > On Thu, Sep 29, 2016, at 02:47, Rustom Mody wrote: >> Your example is exactly what I am saying; if a type has a behavior in >> which all values are always True (true-ish) its a rather strange kind >> of bool-nature. > > For a given type T, if all objects of type T are true (true-ish, truthy, > whatever), it does make using an expression of type T in an if-statement > an incoherent thing to do, but it makes using an expression of type > Union[T, NoneType] reasonable.
Or Union[T, S] where S is some other type (including a union of multiple types) which has at least one falsey value. -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailman/listinfo/python-list