Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
전문가를 위한 파이썬(2판)
by
루시아누 하말류
,
강권학
November 2024
Beginner to intermediate
1064 pages
25h 21m
Korean
Hanbit Media, Inc.
Content preview from
전문가를 위한 파이썬(2판)
497
13
장
인터페이스, 프로토콜, 추상 베이스 클래스
구현이 아니라 인터페이스에 맞게 프로그래밍하라.
1
― 감마
,
헬름
,
존슨
,
블리시디스
객체지향 설계의 첫 번째 원칙
객체지향 프로그래밍은 결국 인터페이스에 관한 것이다. 파이썬에서 타이핑
typing
을 이해하는
가장 좋은 방법은 인터페이스가 제공하는 기법을 이해하는 것이다
(
8
.
4
절 ‘지원되는 연산에 따
라 정의되는 자료형’ 참조
).
1
프로그래밍 언어에 따라 인터페이스를 정의하고 사용하는 방법이 몇 가지 있다. 파이썬
3
.
8
부
터는 [그림
13
-
1
]과 같이 네 가지 방법을 지원하는데, 다음과 같이 요약할 수 있다.
덕 타이핑
초기 파이썬에서부터 기본적으로 적용된 기법이다.
1
장부터 계속 덕 타이핑에 관해 알아보
았다.
구스 타이핑
goose
typing
파이썬
2
.
6
부터 추상 베이스 클래스
(
ABC
)
에서 지원하는 타이핑으로, 객체가
ABC
형인지
런타임에 검사하는 것에 기반한다. 구스 타이핑이 이 장의 핵심 주제이다.
1
『
GoF
의 디자인 패턴(개정판)』( 프로텍미디어,
2015
)의 ‘개요’에서 발췌했다.
인터페이스, 프로토콜, 추상 베이스 클래스
13
CHAPTER
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
전문가를 위한 리액트
테자스 쿠마르
데이터로 전문가처럼 말하기
칼 올친
개발자를 위한 머신러닝&딥러닝
로런스 모로니
고성능 파이썬(2판)
오현석, 미샤 고렐릭, 이안 오스발트
Publisher Resources
ISBN: 9791169211772