In python 2.6.5, an instance of dbm does not have a __nonzero__ or a __len__ method, so why does it evaluate false as a boolean?
>>> a = dbm.open( 'foo', 'c' ) >>> if a: print 'true' ... >>>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to the python documentation one of the types of values that is considered false is
Since a
dbmobject is a mapping and a new instance is empty, it is therefore false.