본문 바로가기

Python Object-oriented Programming49

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.
enum-auto 출처 : https://www.pythontutorial.net/python-oop/python-enum-auto/ Python enum auto In this tutorial, you'll learn about the enum auto() function to generate unique values for enumeration members. www.pythontutorial.net Introduction to the enum auto() function 다음 예제에서는 값이 1, 2 및 3인 세 개의 멤버가 있는 열거형을 정의합니다. from enum import Enum class State(Enum): PENDING = 1 FULFILLED = 2 REJECTED = 3 이 예제에서는 열거형의 .. 2023. 4. 4.
Customize and Extend Python Enum Class 출처 :https://www.pythontutorial.net/python-oop/python-enum-class/ Customize and Extend Python Enum Class Summary: in this tutorial, you’ll learn how to customize and extend the custom Python enum classes. Customize Python enum classes Python enumerations are classes. It means that you can add methods to them, or implement the dunder methods to customize the www.pythontutorial.net Customize Python.. 2023. 4. 4.
num aliases & @enum.unique Decorator 출처 : https://www.pythontutorial.net/python-oop/python-enum-unique/ Python Enumeration Aliases & @enum.unique In this tutorial, you'll learn about enumeration aliases and how to use the enum unique decorator to ensure the uniqueness of member values. www.pythontutorial.net Introduction to the enum aliases 정의에 따라 열거형 멤버 값은 고유합니다. 그러나 동일한 값으로 다른 멤버 이름을 만들 수 있습니다. 예를 들어 다음은 Color 열거형을 정의합니다. from en.. 2023. 4. 4.
enumeration 출처 : https://www.pythontutorial.net/python-oop/python-enumeration/ Introduction to the Python Enumeration 정의에 따라 enumeration(열거형)은 고유한 상수 값을 연결한 멤버들의 집합입니다. 열거형은 종종 enum이라고 합니다. Python은 새 열거형을 정의하기 위한 Enum type을 포함하는 열거형 모듈을 제공합니다 . 또한 Enum 클래스를 서브클래싱하여 새 열거형 type을 정의합니다. 다음 예제에서는 Color라는 열거형을 만드는 방법을 보여 줍니다. from enum import Enum class Color(Enum): RED = 1 GREEN = 2 BLUE = 3 작동 방식. 1. enum 모듈에서.. 2023. 4. 4.
__slots__ Method 출처 :https://www.pythontutorial.net/python-oop/python-__slots__/ Python __slots__ In this tutorial, you will learn about the Python __slots__ and how how to use it to make your class more efficient. www.pythontutorial.net Introduction to the Python __slots__ 다음은 x 및 y 좌표를 포함하는 두 개의 특성이 있는 Point2D 클래스를 정의합니다. class Point2D: def __init__(self, x, y): self.x = x self.y = y def __repr__(self): return.. 2023. 4. 4.