def validate_path(path, element_validator=validate_path_element_default):
 parts = path.split('/')
 for p in parts:
  if (not element_validator(p)):
   return False
 else:
  return True

def validate_path ( path , element_validator = validate_path_element_default ) : parts = path . split ( '/' ) for p in parts : if ( not element_validator ( p ) ) : return False else : return True
default path validator that just checks for .