(python_object)
Check if inspect.getfile has a chance to find the source.
Check if inspect.getfile has a chance to find the source.
Check if inspect . getfile has a chance to find the source .
def _get_object_to_check(python_object):
    """Check if inspect.getfile has a chance to find the source."""
    if (inspect.ismodule(python_object) or
            inspect.isclass(python_object) or
            inspect.ismethod(python_object) or
            inspect.isfunction(python_object) or
            inspect.istraceback(python_object) or
            inspect.isframe(python_object) or
            inspect.iscode(python_object)):
        return python_object

    try:
        return python_object.__class__
    except AttributeError:
        raise TypeError
def _get_object_to_check ( python_object ) : if ( inspect . ismodule ( python_object ) or inspect . isclass ( python_object ) or inspect . ismethod ( python_object ) or inspect . isfunction ( python_object ) or inspect . istraceback ( python_object ) or inspect . isframe ( python_object ) or inspect . iscode ( python_object ) ) : return python_object try : return python_object . __class__ except AttributeError : raise TypeError