Serhiy Storchaka <[email protected]> added the comment:
> Sorry, I should have quoted the doc. " If object is not an object of the
> given type, the function always returns False." Raising instead is a bug --
> even of the object itself is somewhat buggy.
You take it too literally. It does not mean that the function always returns a
value. It can also raise an exception. If you press Ctrl-C it may raise an
exception. If there is no memory to create some temporary objects, it may raise
an exception. If you turn of the computer, it may neither return a value nor
raise an exception.
You created a class whose __class__ attribute always raises an exception. What
do you expect to get when you use this attribute? {}.__getitem__ always raise a
KeyError, because an empty dict does not contain any key.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40180>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com