类与DRY原则

Python 中的软件工程原理

Adam Spannbauer

Machine Learning Engineer at Eastman

创建 SocialMedia 类

  SocialMedia 类文件

Python 中的软件工程原理

DRY 原则

DRY 雨伞

Python 中的软件工程原理

DRY 原则

DRY 雨伞

Python 中的软件工程原理

DRY 原则

DRY 雨伞

Python 中的软件工程原理

DRY 原则

DRY 雨伞

Python 中的软件工程原理

继承入门

  继承自 Document 类

Python 中的软件工程原理

Python中的继承

继承结构

Python 中的软件工程原理

Python中的继承

# Import ParentClass object
from .parent_class import ParentClass

# Create a child class with inheritance class ChildClass(ParentClass): def __init__(self): # Call parent's __init__ method ParentClass.__init__(self)
# Add attribute unique to child class self.child_attribute = "I'm a child class attribute!"
# Create a ChildClass instance child_class = ChildClass() print(child_class.child_attribute) print(child_class.parent_attribute)
Python 中的软件工程原理

Passons à la pratique !

Python 中的软件工程原理

Preparing Video For Download...