(cls, fn, lambda_element, lambda_kw, **kw)
| 736 | |
| 737 | @classmethod |
| 738 | def get(cls, fn, lambda_element, lambda_kw, **kw): |
| 739 | try: |
| 740 | # TODO: validate kw haven't changed? |
| 741 | return cls._fns[fn.__code__] |
| 742 | except KeyError: |
| 743 | pass |
| 744 | |
| 745 | with cls._generation_mutex: |
| 746 | # check for other thread already created object |
| 747 | if fn.__code__ in cls._fns: |
| 748 | return cls._fns[fn.__code__] |
| 749 | |
| 750 | analyzed: AnalyzedCode |
| 751 | cls._fns[fn.__code__] = analyzed = AnalyzedCode( |
| 752 | fn, lambda_element, lambda_kw, **kw |
| 753 | ) |
| 754 | return analyzed |
| 755 | |
| 756 | def __init__(self, fn, lambda_element, opts): |
| 757 | if inspect.ismethod(fn): |
no test coverage detected