def is_valid_module_path_component(token):
"Validate strings to be used when importing modules dynamically."
return not token.startswith('_') and not keyword.iskeyword(token) and \
all( ( (x.isalnum() or x == '_') for x in token ) )
评论列表
文章目录