def is_native(obj, module):
    """
    Determines if obj was defined in module.

    Returns True if obj was defined in this module.
    Returns False if obj was not defined in this module.
    Returns None if we can't figure it out, e.g. if this is a primitive type.
    """
    try:
        return module.__name__ in obj.__module__
    except (AttributeError, TypeError):
        return None