분류 전체보기408 Exceptions https://www.pythontutorial.net/python-oop/python-exceptions/ Introduction to Python exceptions In Python, exceptions are objects of the exception classes. All exception classes are the subclasses of the BaseException class. However, almost all built-in exception classes inherit from the Exception class, which is the subclass of the BaseException class: This page shows a complete class hierarchy .. 2023. 4. 7. enum 기타 기능 enum member를 str화 작업 방법 1. enum base class에 __repr__, __str__메서드를 반환값이 self.name으로 overriding한다. from enum import Enum, auto class StrEnum(str, Enum): def _generate_next_value_(name, start, count, last_values): return name def __repr__(self): return self.name def __str__(self): return self.name 2. 1에서 생성한 열거형 클래스를 멤버를 추가하여 상속 생성한다. class Language(StrEnum): HTML = auto() CSS = auto() JS = auto() .. 2023. 4. 7. Data vs. Non-data Descriptors 출처 : https://www.pythontutorial.net/python-oop/python-data-descriptors/ Python Data vs. Non-data Descriptors Descriptors have two types: Data descriptors are objects of a class that implements __set__ method (and/or __delete__ method) Non-data descriptors are objects of a class that have the __get__ method only. Both descriptor types can optionally implement the __set_name__ method. The __set_na.. 2023. 4. 4. descriptors 출처 :https://www.pythontutorial.net/python-oop/python-descriptors/ Python Descriptors In this tutorial, you'll learn about Python descriptors, how they work, and how to apply them effectively. www.pythontutorial.net Introduction to the Python descriptors 두 개의 인스턴스 속성 ( first_name와 last_name ) 을 가진 Person 클래스가 있다고 가정합니다. class Person: def __init__(self, first_name, last_name): self.first_name = fi.. 2023. 4. 4. Multiple inheritance 출처 : https://www.pythontutorial.net/python-oop/python-multiple-inheritance/ Python Multiple Inheritance In this tutorial, you'll learn about Python multiple inheritance and how method order resolution works in Python. www.pythontutorial.net Introduction to the Python Multiple inheritance. 클래스가 단일 클래스에서 상속되면 단일 상속이다. Python을 사용하면 클래스가 여러 클래스에서 상속받을 수 있습니다. 클래스가 둘 이상의 클래스에서 상속되는 경우 multiple inheri.. 2023. 4. 4. Interface Segregation Principle 출처 :https://www.pythontutorial.net/python-oop/python-interface-segregation-principle/ Python Interface Segregation Principle In this tutorial, you'll learn about the interface segregation principle and how to apply it in Python. www.pythontutorial.net Introduction to the interface segregation principle SOLID는 Uncle Bob에 의한 5 가지 소프트웨어 디자인 원칙을 나타내는 약어입니다. S – Single responsibility Principle O – Op.. 2023. 4. 4. Liskov Substitution Principle 출처 :https://www.pythontutorial.net/python-oop/python-liskov-substitution-principle/ Python Liskov Substitution Principle In this tutorial, you'll learn about the Liskov Substitution Principle and how to implement it in Python. www.pythontutorial.net Introduction to the Liskov substitution principle SOLID는 Uncle Bob에 의한 5 가지 소프트웨어 디자인 원칙을 나타내는 약어입니다. S – Single responsibility Principle O – Open-c.. 2023. 4. 4. Open-closed Principle 출처 : https://www.pythontutorial.net/python-oop/python-open-closed-principle/ Python Open–closed Principle In this tutorial, you'll learn about the open-closed principle to add more functionality to the system without directly modifying existing code. www.pythontutorial.net Introduction to the open-closed principle SOLID는 Uncle Bob에 의한 5 가지 소프트웨어 디자인 원칙을 나타내는 약어입니다. S – Single responsibility Prin.. 2023. 4. 4. Single Responsibility Principle 출처 :https://www.pythontutorial.net/python-oop/python-single-responsibility-principle/ Python Single Responsibility Principle In this tutorial, you'll learn about the Single Responsibility Principle and how to implement it in Python. www.pythontutorial.net What is SOLID SOLID는 Uncle Bob에 의한 5 가지 소프트웨어 디자인 원칙을 나타내는 약어입니다. S – Single responsibility Principle O – Open-closed Principle L – Liskov Sub.. 2023. 4. 4. 이전 1 ··· 16 17 18 19 20 21 22 ··· 46 다음