def valid_attribute(view, pos):
    """attribute in valid scope"""

    if view.match_selector(pos, "source.python comment"):
        return False

    # match f-string
    if view.match_selector(pos, "source.python meta.interpolation.python"):
        return True

    # match common string
    if view.match_selector(pos, "source.python meta.string"):
        return False

    return True