首页 > 解决方案 > Python : Why is: not None = True

问题描述

The title honestly says it all: Why does not None return True. I have seen that bool(None) apparently returns False. Is there a good explanation as to why these two events occur this way ?

Edit: I guess what I'm really asking is what led to python implementing None as being a falsy type ?

标签: pythonbooleannonetype

解决方案


因为否定任何虚假值将导致True.


推荐阅读