This commit is contained in:
2023-03-04 10:48:49 +01:00
parent e9a848835d
commit 5512ec868c
9 changed files with 97 additions and 11 deletions

View File

@@ -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

View File

@@ -1,5 +1,6 @@
from . import Telefonnummer
from . import Person
from . import Anschrift
__all__ = ['telefonnnummer','person','anschrift']

View File

@@ -1,9 +0,0 @@
class Anschrift:
def __init__(self, strasse, hausnummer, plz, ort):
self.strasse = strasse
self.hausnummer = hausnummer
self.plz = plz
self.ort = ort
def __str__(self):
return self.strasse + ' ' + self.hausnummer + '\n' + self.plz + ' ' + self.ort