Skip to content

Commit

Permalink
💄
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbueno committed Aug 11, 2024
1 parent 4697dc6 commit d2134b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
13 changes: 6 additions & 7 deletions extracontext/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class ContextMap(MutableMapping, ContextLocal):

_backend_registry = {}

#def __init__(self, initial: None | Mapping = None, *, backend=None):
#super().__init__()
#if not initial:
#return
#for key, value in initial.items():
#self[key] = value
# def __init__(self, initial: None | Mapping = None, *, backend=None):
# super().__init__()
# if not initial:
# return
# for key, value in initial.items():
# self[key] = value

def __getitem__(self, name):
try:
Expand Down Expand Up @@ -48,7 +48,6 @@ class PyContextMap(ContextMap, PyContextLocal):
_backend_key = "python"
_BASEDIST = 1


def __init__(self, initial: None | Mapping = None, *, backend=None):
super().__init__()
if not initial:
Expand Down
5 changes: 1 addition & 4 deletions tests/test_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,6 @@ def test_contextmap_mapping_enter_new_context_in_with_block(ContextMapClass):

@pytest.mark.parametrize(["ContextMapClass"], [(PyContextMap,), (NativeContextMap,)])
def test_contextmap_accepts_initial_values_map(ContextMapClass):
ctx = ContextMapClass({"a":1})
ctx = ContextMapClass({"a": 1})

assert ctx["a"] == 1



0 comments on commit d2134b3

Please sign in to comment.