Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Type Hints in Deterministic Cache #828

Merged
merged 4 commits into from
Jan 30, 2017
Merged

Add Type Hints in Deterministic Cache #828

merged 4 commits into from
Jan 30, 2017

Conversation

souravsingh
Copy link
Contributor

Fixes a Part of #808

Copy link
Member

@drvinceknight drvinceknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@souravsingh
Copy link
Contributor Author

@drvinceknight @marcharper Is there a type for the variable key?

It is mentioned as Tuple, but I am not sure about the definition.

@marcharper
Copy link
Member

Take a look at the is_valid_key function -- a lot of it is type checking.

@@ -78,7 +79,7 @@ def __setitem__(self, key, value):
super().__setitem__(self._key_transform(key), value)

@staticmethod
def _is_valid_key(key):
def _is_valid_key(key) -> boolean:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bool instead of boolean

@@ -145,7 +146,7 @@ def save(self, file_name: str):
pickle.dump(self.data, io)
return True

def load(self, file_name: str):
def load(self, file_name: str) -> boolean:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

@@ -145,7 +146,7 @@ def save(self, file_name):
pickle.dump(self.data, io)
return True

def load(self, file_name):
def load(self, file_name: str) -> boolean:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to bool rather than boolean

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@meatballs meatballs merged commit f4629b2 into Axelrod-Python:master Jan 30, 2017
@souravsingh souravsingh deleted the add-typehint branch January 30, 2017 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants