def try_len(o: Any) -> int:
if not o:<EOL><INDENT>return None<EOL><DEDENT>try:<EOL><INDENT>return len(o)<EOL><DEDENT>except TypeError:<EOL><INDENT>return None<EOL><DEDENT>
Return len of `o` or None if `o` doesn't support len

    >>> try_len([1, 2])
    2

    >>> try_len(print)
    >>> try_len(None)