Skip to content

Commit

Permalink
add more type notations
Browse files Browse the repository at this point in the history
  • Loading branch information
nitbix committed Sep 13, 2020
1 parent 24b56a4 commit 58f2c64
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion toupee/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def include(self, node):

Loader.add_constructor('!include', Loader.include)

def load_parameters(filename):
def load_parameters(filename: str) -> parameters.Parameters:
""" Loads a parameters file """
with open(filename) as f:
r = yaml.load(f)
Expand Down
4 changes: 2 additions & 2 deletions toupee/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import copy

to_string = ['method']
__STRINGABLE = ['method']
class Parameters(object):

def __init__(self, **entries):
Expand All @@ -19,7 +19,7 @@ def __init__(self, **entries):
def serialize(self):
serialized = copy.deepcopy(self)

for x in to_string:
for x in __STRINGABLE:
if x in serialized.__dict__:
serialized.__dict__[x] = serialized.__dict__[x].serialize()
return serialized.__dict__

0 comments on commit 58f2c64

Please sign in to comment.