"""
pylint/astng bug: inference does not work for overloaded operators
if you remove the "* 2" in this program, pylint works (it can identify that
randint returns either myarray or int). With the "* 2" in place it infers either
YES (ambiguous) or int and pylint flags a warning.
"""

class myarray:
    def __init__(self, array):
        self.array = array

    def __mul__(self, x):
        return myarray([2,4,6])

    def astype(self):
        return "ASTYPE"

def randint(maximum):
    if maximum is not None:
        return myarray([1,2,3]) * 2
    else:
        return int(5)

print randint(1).astype()

