Terry J. Reedy <tjre...@udel.edu> added the comment:

I consider it a nice feature of Python that all builtin objects, and, AFAIK 
(and Josh, apparently), all stdlib class instances, have a boolean value.  (I 
am aware of numpy's element-wise behavior.)  I hate to give this up.  This is 
part of Python's general avoidance of singular exceptions and exceptions to 
exceptions.  This proposal would be the latter: "An object is truthy, unless 
its class makes it false, unless it is NotImplemented and a TypeError."

If this exception is made, I expect that there will be proposals to extend the 
exception to other objects, such as Ellipsis.

----------
nosy: +terry.reedy
stage:  -> test needed
type: behavior -> enhancement
versions: +Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35712>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to