(self, fn, lambda_element, opts)
| 754 | return analyzed |
| 755 | |
| 756 | def __init__(self, fn, lambda_element, opts): |
| 757 | if inspect.ismethod(fn): |
| 758 | raise exc.ArgumentError( |
| 759 | "Method %s may not be passed as a SQL expression" % fn |
| 760 | ) |
| 761 | closure = fn.__closure__ |
| 762 | |
| 763 | self.track_bound_values = ( |
| 764 | opts.track_bound_values and opts.global_track_bound_values |
| 765 | ) |
| 766 | enable_tracking = opts.enable_tracking |
| 767 | track_on = opts.track_on |
| 768 | track_closure_variables = opts.track_closure_variables |
| 769 | |
| 770 | self.track_closure_variables = track_closure_variables and not track_on |
| 771 | |
| 772 | # a list of callables generated from _bound_parameter_getter_* |
| 773 | # functions. Each of these uses a PyWrapper object to retrieve |
| 774 | # a parameter value |
| 775 | self.bindparam_trackers = [] |
| 776 | |
| 777 | # a list of callables generated from _cache_key_getter_* functions |
| 778 | # these callables work to generate a cache key for the lambda |
| 779 | # based on what's inside its closure variables. |
| 780 | self.closure_trackers = [] |
| 781 | |
| 782 | self.build_py_wrappers = [] |
| 783 | |
| 784 | if enable_tracking: |
| 785 | if track_on: |
| 786 | self._init_track_on(track_on) |
| 787 | |
| 788 | self._init_globals(fn) |
| 789 | |
| 790 | if closure: |
| 791 | self._init_closure(fn) |
| 792 | |
| 793 | self._setup_additional_closure_trackers(fn, lambda_element, opts) |
| 794 | |
| 795 | def _init_track_on(self, track_on): |
| 796 | self.closure_trackers.extend( |
nothing calls this directly
no test coverage detected