s = "hello" # length() == 5
print s
print len(s)
s = "Hello"
s = s.lower()
print s
class EmcCollection:
def insert(self,t):
pass
def operator(self, coll):
pass
class EmcArrayCollection(EmcCollection):
initialSize = 10
def __init__(self,maxsize):
pass
"""
class InvalidCollectionType(EmcException):
def __init__(self,i):
pass
"""
class EmcCollectionFactory:
def __init__(self):
pass
def create(self,type):
pass
def createArray(self):
pass
class EmcCollectionFactory:
def __init__(self):
pass
def create(self,type):
pass
def createArray(self):
pass
factory = EmcCollectionFactory()
collection = factory.create("Array")
collection.insert(42); # EmcArrayCollection<int>::insert() is called
print collection
class EmcCollection:
def __del__(self):
pass
class EmcArrayCollection( EmcCollection):
def __del__(self):
pass
class EmcLogged:
def writeClassName(self,o):
pass
def writeValue(self,o):
pass
def logMessage(self,message):
pass
def __del__(self):
pass
class EmcLoggedCollection(EmcCollection):
def writeValue(self,o):
pass
def __del__(self):
pass
class EmcIntStack:
def empty(self):
pass
def full(self):
pass
def top(self):
pass
def push(self,i):
pass
def pop(self):
pass
def makeString(stack):
returnValue = ''
copy = stack
while (not copy.empty()):
# loop condition makes precondition valid
print copy.pop() # Precondition: ! copy.empty()
returnValue += copy.pop
return returnValue;
class EmcString:
def cStr(self):
pass
# cStr() returns 0-terminated string
def length(self):
pass
class EmcCollection:
def __del__(self):
pass
def insert(self,T):
pass
def clear(self):
pass
def remove(self):
pass
class EmcCollectionFactory:
def __init__(self):
pass
def create(self,type):
pass
def createArray(self):
pass
factrory = EmcCollectionFactory()
collection = factory.create("Array");
if (not collection.isFull()):
collection.insert(42);
def insertObject(c,element):
if (not c.isFull()):
c.insert(element)
return True
return False
def insert(T):
pass
class EmcCollection:
pass
class EmcCollection:
def templateRequirements(self):
pass
def templateRequirements(self):
t1 = T1()
t2 =t1
t2 = t1;
# Assignable
b = (t2 == t1); # EqualityComparable