Skip to content

Commit

Permalink
docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
cathteng committed Dec 14, 2024
1 parent 9e54f56 commit d454769
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sentry/utils/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ class NoRegistrationExistsError(ValueError):


class Registry(Generic[T]):
"""
A simple generic registry that allows for registering and retrieving items by key. Reverse lookup by value is enabled by default.
If you have duplicate values, you may want to disable reverse lookup.
"""

def __init__(self, enable_reverse_lookup=True):
self.registrations: dict[str, T] = {}
self.reverse_lookup: dict[T, str] = {}
Expand Down

0 comments on commit d454769

Please sign in to comment.