Skip to content

Commit 5d48d33

Browse files
committed
Rename ATTR_SCTS to sct_dict in sct_syntax for xwhat consistency
1 parent 1140abb commit 5d48d33

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pythonwhat/sct_syntax.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from functools import wraps
88

99
# TODO: could define scts for check_wrappers at the module level
10-
ATTR_SCTS = scts.copy()
10+
sct_dict = scts.copy()
1111

1212

1313
def multi_dec(f):
@@ -27,16 +27,16 @@ def wrapper(*args, **kwargs):
2727
return wrapper
2828

2929

30-
state_dec = state_dec_gen(State, ATTR_SCTS)
30+
state_dec = state_dec_gen(State, sct_dict)
3131

3232

3333
class Chain(ProtoChain):
34-
def __init__(self, state, attr_scts=ATTR_SCTS):
34+
def __init__(self, state, attr_scts=sct_dict):
3535
super().__init__(state, attr_scts)
3636

3737

3838
class F(ProtoF):
39-
def __init__(self, stack=None, attr_scts=ATTR_SCTS):
39+
def __init__(self, stack=None, attr_scts=sct_dict):
4040
super().__init__(stack, attr_scts)
4141

4242

@@ -49,17 +49,17 @@ def Ex(state=None):
4949
# decorate functions that may try to run test_* function nodes as subtests
5050
# so they remove those nodes from the tree
5151
for k in ["multi", "with_context"]:
52-
ATTR_SCTS[k] = multi_dec(ATTR_SCTS[k])
52+
sct_dict[k] = multi_dec(sct_dict[k])
5353

5454
# allow test_* functions as chained attributes
5555
for k in TEST_NAMES:
56-
ATTR_SCTS[k] = Probe(tree=None, f=getattr(test_funcs, k), eval_on_call=True)
56+
sct_dict[k] = Probe(tree=None, f=getattr(test_funcs, k), eval_on_call=True)
5757

5858
# original logical test_* functions behave like multi
5959
# this is necessary to allow them to take check_* funcs as args
6060
# since probe behavior will try to call all SCTs passed (assuming they're also probes)
6161
for k in ["test_or", "test_correct"]:
62-
ATTR_SCTS[k] = multi_dec(getattr(test_funcs, k))
62+
sct_dict[k] = multi_dec(getattr(test_funcs, k))
6363

6464
# Prepare check_funcs to be used alone (e.g. test = check_with().check_body())
6565
v2_check_functions = {k: state_dec(v) for k, v in scts.items()}

0 commit comments

Comments
 (0)