Skip to content
Unverified Commit 46431ee2 authored by Matt Smith's avatar Matt Smith Committed by GitHub
Browse files

Cache mapped functions (#531)

* avoid traversing functions multiple times

* condense function cache setup

* pass function cache to CombineMapper.__init__ too

* use Never instead of None as the function result type for mappers that don't support functions

* remove multiple inheritance for TransformMapperWithExtraArgs

doesn't appear to be needed

* add _verify_is_array to avoid the need for rec_ary

the latter inflates recursion depth

* remove map_foreign from Mapper

* use Never as FunctionResultT for NumpyCodegenMapper and FancyDotWriter too

* make PlaceholderSubstitutor explicit about not supporting functions

* tweak types in rec/rec_function_definition

* use P.args/P.kwargs in CachedWalkMapper

* use a more specific type than Any for cache key in CachedWalkMapper

* remove some more Anys
parent 377289cc
Loading
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment