I am using python library tinydb
to store data.
According to tinydb
documentation, the proper syntax for an example query is:
User = Query()
db.search(User.birthday.year == 1990)
Why don't we need:
User = Query()
db.search(lambda User: User.birthday.year == 1990)
db.search
is a function that is only called once. This means that the function is receiving a fixed value (the result of a comparison) as an input, not a function to serve as a comparator?
How does the tinydb
library achieve this weird syntax?