Summary
functools.partial and functools.lru_cache were deferred from stdlib Phase 2 because they require features not yet available in Sharpy:
partial(func, *args): Needs a runtime callable wrapper that captures partial arguments. Challenging with Sharpy's static type system — requires creating a generic wrapper or using Func<> delegation.
lru_cache(maxsize=128): Needs decorator argument support in the compiler. Currently decorators are recognized but decorator arguments are not fully supported.
cache: Alias for lru_cache(maxsize=None), blocked by same issue.
Current State
functools.reduce() and functools.cmp_to_key() are implemented and working
partial, lru_cache, cache are not implemented
Possible Approaches
partial: Could use object[] captured args with runtime dispatch, or generate specialized Func<> wrappers
lru_cache: Requires compiler support for @decorator(args) syntax generating wrapper code
Context
Deferred from stdlib Phase 2 plan.
Summary
functools.partialandfunctools.lru_cachewere deferred from stdlib Phase 2 because they require features not yet available in Sharpy:partial(func, *args): Needs a runtime callable wrapper that captures partial arguments. Challenging with Sharpy's static type system — requires creating a generic wrapper or usingFunc<>delegation.lru_cache(maxsize=128): Needs decorator argument support in the compiler. Currently decorators are recognized but decorator arguments are not fully supported.cache: Alias forlru_cache(maxsize=None), blocked by same issue.Current State
functools.reduce()andfunctools.cmp_to_key()are implemented and workingpartial,lru_cache,cacheare not implementedPossible Approaches
partial: Could useobject[]captured args with runtime dispatch, or generate specializedFunc<>wrapperslru_cache: Requires compiler support for@decorator(args)syntax generating wrapper codeContext
Deferred from stdlib Phase 2 plan.