import inspect


def is_classmethod(cls, method):
    """
    Check if a method is a classmethod. Supports Python 2/3.
    :ref: https://stackoverflow.com/questions/19227724/check-if-a-function-uses-classmethod
    :param cls: Class
    :type cls: type
    :param method: Name of the method to check
    :type method: callable
    :rtype: bool
    """
    return inspect.ismethod(method) and hasattr(method, '__self__') and getattr(method, '__self__') is cls