[python] Check if a number is a perfect square

import math

def is_square(n):
    sqrt = math.sqrt(n)
    return sqrt == int(sqrt)

It fails for a large non-square such as 152415789666209426002111556165263283035677490.