test: python
This commit is contained in:
parent
a2a0c5a991
commit
2dcb66eda5
3 changed files with 27 additions and 1 deletions
|
|
@ -0,0 +1,26 @@
|
|||
# File: base_module.py
|
||||
|
||||
class BaseClass:
|
||||
def __init__(self):
|
||||
print("BaseClass initialized")
|
||||
|
||||
class Collection:
|
||||
def __init__(self):
|
||||
print("Collection initialized")
|
||||
|
||||
class Address:
|
||||
def __init__(self, street: str, city: str, zip_code: str):
|
||||
self.street = street
|
||||
self.city = city
|
||||
self.zip_code = zip_code
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.street}, {self.city}, {self.zip_code}"
|
||||
|
||||
class Person:
|
||||
def __init__(self, name: str, address: Address):
|
||||
self.name = name
|
||||
self.address = address
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.name} lives at {self.address}"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
from base_module import BaseClass, Collection, Person, Address
|
||||
from .base_module import BaseClass, Collection, Person, Address
|
||||
from typing import List
|
||||
|
||||
def get_address(person: Person) -> Address:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue