teil8.
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
from partner.Anschrift import Anschrift
|
||||
|
||||
class Person:
|
||||
# Konstruktor
|
||||
def __init__(self,vorname, name):
|
||||
def __init__(self,vorname, name,anschrift):
|
||||
self.vorname = vorname
|
||||
self.name = name
|
||||
|
||||
print(type(Anschrift))
|
||||
if anschrift == None:
|
||||
raise TypeError('anschrift darf nicht None sein')
|
||||
|
||||
if not isinstance(anschrift, Anschrift):
|
||||
raise TypeError('anschrift ist vom falschen Typ')
|
||||
|
||||
self.anschrift = anschrift
|
||||
|
Reference in New Issue
Block a user