Best way to check if an object is None?

后端 未结 1 1498
遇见更好的自我
遇见更好的自我 2021-01-28 18:27

How should I fix this error? Seems like an unresolved issue in this repository: https://github.com/shayanzare007/EntitySentiment/issues/7

$ python RunRNN.py 
Num         


        
相关标签:
1条回答
  • 2021-01-28 18:42

    When testing an object for nullity, the recommended practice is to always use is:

    if idxiter is None:
        ...
    

    It's safer, especially because not all objects support equality comparisons with None.

    0 讨论(0)
提交回复
热议问题