Skip to content

Commit

Permalink
Type annotations added.
Browse files Browse the repository at this point in the history
  • Loading branch information
graninas committed Feb 21, 2020
1 parent eb5c2bf commit d036b9d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import random
from abc import *
from enum import Enum
from services.knowledge_base.math_object import IMathObject


class IKnowledgeBase(metaclass = ABCMeta):

@abstractmethod
def find_obj(self, obj_name): pass
def find_obj(self, obj_name : str) -> IMathObject:
pass
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
class IMathObject(INotion, metaclass = ABCMeta):

@abstractmethod
def get_description(self): pass
def get_description(self) -> str:
pass



class GenericMathObject(IMathObject):
def __init__(self, name, description):
def __init__(self, name : str, description : str):
self.__name = name
self.__description = description

def get_name(self):
def get_name(self) -> str:
return self.__name

def get_description(self):
def get_description(self) -> str:
return self.__description
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
class INotion(metaclass = ABCMeta):

@abstractmethod
def get_name(self): pass
def get_name(self) -> str:
pass

0 comments on commit d036b9d

Please sign in to comment.