Changeset 213
- Timestamp:
- 11/05/07 12:54:43
- Files:
-
- trunk/geniusql/logic.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/geniusql/logic.py
r212 r213 267 267 func: a function, with positional args and optional keyword args, 268 268 which must return bool. If func is None, it is initialized to 269 "lambda x: True". 269 "lambda *args, **kwargs: True". If func is a dict, logic.filter 270 will be used to create an Expression from it. 270 271 kwtypes: a dictionary of {keyword: type} pairs. 271 272 earlybind: if True (the default), the given function will be … … 367 368 """Return True if self.func == (lambda: value), False otherwise.""" 368 369 fc = self.func.func_code 369 return fc.co_code == 'd\x01\x00S' and fc.co_consts == (None, value) 370 return (fc.co_code == 'd\x01\x00S' and 371 # i.e., fc.co_consts == (docstring or None, value) 372 len(fc.co_consts) == 2 and fc.co_consts[1] == value) 370 373 371 374
