'''
Conflicting method names in python
'''

class ConflictCheck(type):
    def __new__(meta, name, bases, dct):
        # determine attributes per base class, except for magic ones
        attrs_per_base = [set(a for a in dir(b) if not a.startswith("__"))
                          for b in bases]
        if len(set.union(*attrs_per_base)) < sum(map(len, attrs_per_base)):
            raise ValueError("attribute conflict")
        return super(ConflictCheck, meta).__new__(meta, name, bases, dct)

class Tiger():
    @staticmethod
    def speak():
        print "Rawr!";
        
class Lion():
    @staticmethod
    def speak():
        print "Roar!";

class Liger(Lion, Tiger):
    __metaclass__ = ConflictCheck  # will raise an error at definition time

Liger.speak(); ''' this prints "Rawr" instead of printing an error message. '''
'''Is there any way to detect method name collisions like this one?'''