Klassen en het DRY-principe

Software-engineeringprincipes in Python

Adam Spannbauer

Machine Learning Engineer at Eastman

Een SocialMedia-klasse maken

  Social Media Klasse Bestand

Software-engineeringprincipes in Python

Het DRY-principe

DRY Paraplu

Software-engineeringprincipes in Python

Het DRY-principe

DRY Paraplu

Software-engineeringprincipes in Python

Het DRY-principe

DRY Paraplu

Software-engineeringprincipes in Python

Het DRY-principe

DRY Paraplu

Software-engineeringprincipes in Python

Introductie tot overerving

  Overerven van Documentklasse

Software-engineeringprincipes in Python

Overerving in Python

Overervingsstructuur

Software-engineeringprincipes in Python

Overerving in Python

# Importeer ParentClass object
from .parent_class import ParentClass

# Maak een kindklasse met overerving class ChildClass(ParentClass): def __init__(self): # Roep de __init__-methode van de ouder aan ParentClass.__init__(self)
# Voeg een attribuut toe dat uniek is voor de kindklasse self.child_attribute = "I'm a child class attribute!"
# Maak een instantie van ChildClass child_class = ChildClass() print(child_class.child_attribute) print(child_class.parent_attribute)
Software-engineeringprincipes in Python

Aan de slag

Software-engineeringprincipes in Python

Preparing Video For Download...