import types 

class Clovek:
	identifikator = 0
	def initclass(clazz):
		clazz.identifikator=0
		initclass = classmethod(initclass) # class method (decorator)
	def predstav_se(self):
		print ("Ahoj, ja jsem %s" % self.jmeno)
	def rekni(self, word):
		return (word)
	# kazda methoda ma prvni param "self" do ktere se pri zavolani preda self	a nemusi se jmenovat self ;-)
	def jmeno(self): 
		return rekni(self.jmeno)
	# vola se automaticky pri vytvareni instance
	def __init__(self, jmeno, vek=0, trida=""):
		self.jmeno=jmeno
		self.vek=vek
		#self.identifikator = Clovek.identifikator
		#Clovek.identifikator+=1
		self.identifikator = self.__class__.identifikator
		self.__class__.identifikator += 1
	def __add__ (self, other):
		return self.vek + other.vek
	def __str__ (self):
		return ("Jmeno: %s %s" % (self.jmeno, self.vek))
	def __del__ (self):
		print ("Jmeno: %s konci" % self.jmeno)


# a = 1 ..=.. a = Int(1)
# import = math ..=.. math = Module("math")
# def secti(a,b) ..=.. 


# student je subclass Cloveka

class Student(Clovek):
	def __init__(self, jmeno="", vek=0, trida="1A")
	Clovek.__init__(self,jmeno,vek)
	
	# python 3
	#super().__init__(self,jmeno,vek)
	
	self.trida = trida
	pass

class Ucitel(Clovek):
	pass


class MujInt(types.IntType):
	pass

class mujList(types.ListType):
	def __str__(self):
		for s in self:
			print ("item: %s" % s.str)

honza = Clovek("Jan", 12)
#honza.jmeno = "Jan"
#honza.vek = 10
			
honza.predstav_se
			
pepa = Clovek("Josef", 34)
michal = Clovek("Michal", 44)

lidi = (pepa,honza, michal)
print (pepa)
print (lidi)
print (honza + pepa)



ucitel = Ucitel("Jan Vrbata", 38)
students = (Student("Karel Gott1", 177), Student("Karel Gott2", 277), Student("Karel Gott3", 377))
studentici = mujListStudent("Karel Gott1", 177), Student("Karel Gott2", 277), Student("Karel Gott3", 377) 


print ("ucitel: %s" % ucitel)

for s in students:
	print ("student: %s" % s)

print (studentici)
	

		
	
		
		

	
	
