埃菲尔铁塔(Eiffel):附加到check语句中的未知标识符

时间:2018-10-12 16:38:21

标签: design-by-contract eiffel void-safety

    require
        valid_item: attached item as l_i and then l_i.valid_for_insert or l_i.valid_for_update

为什么我的l_i有一个未知的标识符?? !!!

1 个答案:

答案 0 :(得分:3)

尝试

import pyodbc 

one = 0

conn = pyodbc.connect(r'DSN=MACCD')
cursor = conn.cursor()
cursor.execute('SELECT first,second,third,fourth,fifth FROM ExampDatabase')

if "1 is detected in the database":
    one += 1
print(one)

请注意,您也可以这样做

valid_item: attached item as l_i and then (l_i.valid_for_insert or l_i.valid_for_update)

您可以从先前的前提条件中重用对象测试局部变量item_set: attached item as l_i valid_item: l_i.valid_for_insert or l_i.valid_for_update