Message365801
> 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. |
|
Date |
User |
Action |
Args |
2020-04-04 22:54:24 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, terry.reedy, BTaskaya |
2020-04-04 22:54:24 | serhiy.storchaka | set | messageid: <1586040864.6.0.479972009257.issue40180@roundup.psfhosted.org> |
2020-04-04 22:54:24 | serhiy.storchaka | link | issue40180 messages |
2020-04-04 22:54:24 | serhiy.storchaka | create | |
|