Starting Sheerka, learning Python

This commit is contained in:
Kodjo Sossouvi
2019-07-18 23:55:14 +02:00
commit ab57a84956
9 changed files with 283 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
class Concept:
"""
Default concept object
A concept is a the base object of our universe
Everything is a concept
"""
concepts_id = 0
def __init__(self, name, is_builtin=False):
self.name = name
self.is_builtin = is_builtin
self.pre = None # list of pre conditions before calling the main function
self.post = None # list of post conditions after calling the main function
self.main = None # main method
self.id = Concept.concepts_id
Concept.concepts_id = Concept.concepts_id + 1
self.props = [] # list of Property for this concept
self.functions = {} # list of helper functions
def __str__(self):
return f"({self.id}){self.name}"
def __repr__(self):
return f"({self.id}){self.name}"
class Property:
"""
Defines a behaviour of Concept
"""
def __init__(self, concept, value):
self.concept = concept
self.value = value