I am learning sqlachemy, I'm relatively new to Python.
When I read its documentation, I saw this kind of usage, for example:
query.filter(User.name == 'ed')
Wouldn't Python evaluate the expression User.name == 'ed'
and then pass the result, which is a boolean, to query.filter
method?
How does this kind of syntax work? Does Python support some kind of operator overriding like C++?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…