From d4547694a57eb87657f963be49bb574d1d421898 Mon Sep 17 00:00:00 2001 From: Cathy Teng Date: Fri, 13 Dec 2024 16:48:36 -0800 Subject: [PATCH] docstring --- src/sentry/utils/registry.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sentry/utils/registry.py b/src/sentry/utils/registry.py index d76894e1709e5a..3eff6865e82051 100644 --- a/src/sentry/utils/registry.py +++ b/src/sentry/utils/registry.py @@ -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] = {}