sqlalchemy / sqlalchemy/dogpile.cache
method support in function_key_generator / function_multi_key_generator
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 299
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
Migrated issue, originally created by Wolfgang Schnerring (wosc)
It would be nice if function_key_generator would support methods in addition to plain functions.
An example implementation is here: https://github.com/ZeitOnline/pyramid_dogpile_cache2/blob/1.0.1/src/pyramid_dogpile_cache2/cache.py#L26
I haven't found a way to do this other than computing the namespace during each function call (instead of only once and storing it in the closure), since at definition time I think you don't have enough information about the function etc. available.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementations of function_key_generator and function_multi_key_generator, then compare their behavior with the example in pyramid_dogpile_cache2/cache.py. Determine how method support should work without losing the existing function behavior, and define completion by covering both generators and their method use cases with tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100