117 driver.switch_to.alert.accept()
118
119
120def expectInputIsEmpty(input):121 def _predicate(driver:WebDriver):
122 target = driver.find_element(*input)
123 return target.get_property("value") == ""
84 return PATH_UNKNOWN
85
86
87def mkdir(dir, force = False): 88 if path.exists(dir):
89 if force:
90 delete(dir)
112 else:
113 for root, dirs, files in os.walk(source):
114 mkdir(path.join(dest, root))
115 for dir in dirs:116 mkdir(path.join(dest, root, dir))
117 for file in files:
118 shutil.copy(path.join(root, file), path.join(dest, root, file))
Defining a local variable or function with the same name as a built-in object makes the built-in object unusable within the current scope and makes the code prone to bugs.
dict = {} # dict is a Python builtin!
for idx, student in enumerate(students):
dict[student] = idx
roll_number = {}
for idx, student in enumerate(students):
roll_number[student] = idx