def check_hash_key ( query_on , key ) : return ( isinstance ( key , BaseCondition ) and ( key . operation == "==" ) and ( key . column is query_on . hash_key ) )
python determine key is equal
Only allows == against query_on . hash_key
def check_hash_key(query_on, key):
    """Only allows == against query_on.hash_key"""
    return (
        isinstance(key, BaseCondition) and
        (key.operation == "==") and
        (key.column is query_on.hash_key)
    )