Skip to content

Commit 043490c

Browse files
authored
Merge pull request #162 from Daraan/main
deterministic in-order iteration of class variables
2 parents 7f36ff2 + 85104e7 commit 043490c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/tap/tap.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,12 @@ def _get_class_variables(self) -> dict:
546546
class_variables = self._get_from_self_and_super(extract_func=get_class_variables)
547547

548548
# Handle edge-case of source code modification while code is running
549-
variables_to_add = class_variable_names - class_variables.keys()
550-
variables_to_remove = class_variables.keys() - class_variable_names
549+
variables_to_add = (
550+
variable for variable in class_variable_names if variable not in class_variables
551+
)
552+
variables_to_remove = (
553+
variable for variable in class_variables.keys() if variable not in class_variable_names
554+
)
551555

552556
for variable in variables_to_add:
553557
class_variables[variable] = {"comment": ""}

0 commit comments

Comments
 (0)