Python selenium WebDriverWait中until自己写的方法为什么只调用一次

大致代码如下,until里的方法是自己写的len_is_true,判断输入框输入的内容长度为5,我在方法里打印了'循环方法',貌似len_is_true方法只调用了一次,并不是在30秒内每0.5秒调用一次,哪位大侠知道原因,多谢。

def len_is_true ():
print '循环方法'
js = 'return document.getElementById("welLogin_username").value'
username = driver.execute_script(js)
print username
return lambda x: True if len(username) ==5 else False

mobileEmulation = {'deviceName': 'Apple iPhone 6'}
options = webdriver.ChromeOptions()
options.add_experimental_option('mobileEmulation', mobileEmulation)

driver = webdriver.Chrome(executable_path='chromedriver.exe', chrome_options=options)
driver.get('xxxxxxxxxxxxxxx')
try:

WebDriverWait(driver, 30, 0.5).until(len_is_true())

except TimeoutException:
print ‘TimeoutException’

图片说明
我把代码改了下,如图所示,如果30秒内每0.5秒执行一次,打印出的日志应该有很多‘循环方法’才对

我是菜鸟 有人帮回答吗TT

until方法里的方法len_is_true定义确认正确?网上资料说这个自定义方法必须包含__call__()方法,而且我用until时,提示里面的方法必须接受2个参数。仅供参考。