Skip to content

Commit

Permalink
add initial value
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowin committed Apr 24, 2024
1 parent 142082b commit 338e770
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/marvin/utilities/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class ScopedContext:
```
"""

def __init__(self):
"""Initializes the ScopedContext with a default empty dictionary."""
def __init__(self, initial_value: dict = None):
"""Initializes the ScopedContext with an initial valuedictionary."""
self._context_storage = contextvars.ContextVar(
"scoped_context_storage", default={}
"scoped_context_storage", default=initial_value or {}
)

def get(self, key: str, default: Any = None) -> Any:
Expand Down

0 comments on commit 338e770

Please sign in to comment.