Skip to content

Commit

Permalink
Merge branch 'master' into _update-deps/runtimeverification/evm-seman…
Browse files Browse the repository at this point in the history
…tics
  • Loading branch information
palinatolmach authored Oct 9, 2024
2 parents 48a36f0 + 1a2ac9e commit 8886404
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/kontrol/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,13 +477,18 @@ def __str__(self) -> str:
The first line collects all attributes that are directly set on the instance.
The loop is required to iterate over all parent classes and fetch attributes set by the `default` method.
Default values from parent classes will only be used if the attribute is not explicitly set.
:return: String representation of the instance.
"""
options_dict = {**self.__dict__}

for parent in self.__class__.__bases__:
if hasattr(parent, 'default'):
options_dict.update(parent.default())
parent_defaults = parent.default()
for key, value in parent_defaults.items():
if key not in options_dict:
options_dict[key] = value

options_str = ', '.join(f'{key}: {value}' for key, value in options_dict.items())
return f'ProveOptions({options_str})'
Expand Down Expand Up @@ -881,13 +886,18 @@ def __str__(self) -> str:
The first line collects all attributes that are directly set on the instance.
The loop is required to iterate over all parent classes and fetch attributes set by the `default` method.
Default values from parent classes will only be used if the attribute is not explicitly set.
:return: String representation of the instance.
"""
options_dict = {**self.__dict__}

for parent in self.__class__.__bases__:
if hasattr(parent, 'default'):
options_dict.update(parent.default())
parent_defaults = parent.default()
for key, value in parent_defaults.items():
if key not in options_dict:
options_dict[key] = value

options_str = ', '.join(f'{key}: {value}' for key, value in options_dict.items())
return f'BuildOptions({options_str})'

0 comments on commit 8886404

Please sign in to comment.