Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pytools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
pytools
Commits
5b4aa1e2
Commit
5b4aa1e2
authored
4 years ago
by
Andreas Klöckner
Browse files
Options
Downloads
Patches
Plain Diff
Document persistent_dict.KeyBuilder
parent
773dd380
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pytools/persistent_dict.py
+16
-0
16 additions, 0 deletions
pytools/persistent_dict.py
with
16 additions
and
0 deletions
pytools/persistent_dict.py
+
16
−
0
View file @
5b4aa1e2
...
...
@@ -173,6 +173,22 @@ class ItemDirManager(CleanupBase):
# {{{ key generation
class
KeyBuilder
:
"""
A (stateless) object that computes hashes of objects fed to it. Subclassing
this class permits customizing the computation of hash keys.
.. automethod:: __call__
.. automethod:: rec
.. staticmethod:: new_hash()
Return a new hash instance following the protocol of the ones
from :mod:`hashlib`. This will permit switching to different
hash algorithms in the future. Subclasses are expected to use
this to create new hashes. Not doing so is deprecated and
may stop working as early as 2022.
.. versionadded:: 2021.1.3
"""
# this exists so that we can (conceivably) switch algorithms at some point
# down the road
new_hash
=
hashlib
.
sha256
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment