Finish adding type-annotations thoughout the code.

This commit is contained in:
Mike Auty
2017-12-13 20:48:52 +00:00
parent ee12b81f4a
commit 942de5f166
13 changed files with 164 additions and 101 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ class ReadOnlyMapping(validity.ValidityRoutines, collections.abc.Mapping):
This ensures that the data stored in the mapping should not be modified, making an immutable mapping.
"""
def __init__(self, dictionary: typing.ChainMap[str, typing.Any]) -> None:
def __init__(self, dictionary: typing.Mapping[str, typing.Any]) -> None:
self._dict = dictionary
def __getattr__(self, attr: str) -> typing.Any:
+2 -2
View File
@@ -174,14 +174,14 @@ class BaseSymbolTableInterface(validity.ValidityRoutines):
# ## Functions for overriding classes
def set_type_class(self, name: str, clazz: objects.ObjectInterface) -> None:
def set_type_class(self, name: str, clazz: typing.Type[objects.ObjectInterface]) -> None:
"""Overrides the object class for a specific Symbol type
Name *must* be present in self.types
"""
raise NotImplementedError("Abstract method set_type_class not implemented yet.")
def get_type_class(self, name: str) -> objects.ObjectInterface:
def get_type_class(self, name: str) -> typing.Type[objects.ObjectInterface]:
"""Returns the class associated with a Symbol type"""
raise NotImplementedError("Abstract method get_type_class not implemented yet.")