| 393 | return expr |
| 394 | |
| 395 | def _gen_cache_key(self, anon_map, bindparams): |
| 396 | if self.closure_cache_key is _cache_key.NO_CACHE: |
| 397 | anon_map[_cache_key.NO_CACHE] = True |
| 398 | return None |
| 399 | |
| 400 | cache_key = ( |
| 401 | self.fn.__code__, |
| 402 | self.__class__, |
| 403 | ) + self.closure_cache_key |
| 404 | |
| 405 | parent = self.parent_lambda |
| 406 | |
| 407 | while parent is not None: |
| 408 | assert parent.closure_cache_key is not CacheConst.NO_CACHE |
| 409 | parent_closure_cache_key: Tuple[Any, ...] = ( |
| 410 | parent.closure_cache_key |
| 411 | ) |
| 412 | |
| 413 | cache_key = ( |
| 414 | (parent.fn.__code__,) + parent_closure_cache_key + cache_key |
| 415 | ) |
| 416 | |
| 417 | parent = parent.parent_lambda |
| 418 | |
| 419 | if self._resolved_bindparams: |
| 420 | bindparams.extend(self._resolved_bindparams) |
| 421 | return cache_key |
| 422 | |
| 423 | def _invoke_user_fn(self, fn: _AnyLambdaType, *arg: Any) -> ClauseElement: |
| 424 | return fn() # type: ignore[no-any-return] |