pylint-bot / test

0 stars 0 forks source link

Support falsey classes for bool_value #183

Open pylint-bot opened 8 years ago

pylint-bot commented 8 years ago

Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore?)


This is not very important, but it's worth a fix sometimes in the future. For the given example, Class.bool_value will return true, even though the class uses a metaclass which gives it a falsey value.

#!python

from astroid import parse
cls = parse('''
class Meta(type):
    def __len__(self):
       return 0

class C(metaclass=Meta):
    pass
''')['C']
print(cls.bool_value())