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