- Optimization: Define
__slots__
onContextTimer
- This makes
ContextTimer
objects slightly smaller and attribute lookups slightly faster
- This makes
- Quality of Life: By default, set expiration on
CachedOrderedDict
s- Prior to this, if you had a large keyspace, your
CachedOrderedDict
could've grown unbounded - The timeout defaults to 1 minute
- The timeout gets reset back to 1 minute every time you set a key
- If your keyspace has a known/controlled cardinality, you can disable the timeout by passing
timeout=None
toCachedOrderedDict.__init__()
- Prior to this, if you had a large keyspace, your
What's Changed
- Create codeql-analysis.yml by @brainix in #276
- Add CodeQL status badge by @brainix in #277
- Define slots on ContextTimer by @brainix in #278
- In random_key(), type/value check num_tries by @brainix in #279
- By default, set expiration on CachedOrderedDicts by @brainix in #280
- Test self-assigned keys get del when out of scope by @brainix in #281
- Bump version number by @brainix in #282
Full Changelog: v1.0.3...v1.0.4