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판)
468
3
부
클래스와 프로토콜
components
배열에 직접 적용하고 나서
[]
바깥쪽에 있는 글자들을 잘라냈다. [예제
12
-
2
]의
__repr__(
)
메서드 두 번째 줄이 실행하는 것이 바로 이 과정이다.
TIP
디버깅할 때도 사용하므로, 객체에 호출한
repr()
은 절대 예외를 발생시키면 안 된다.
__repr__()
코드 안에서 무언가 잘못되면 문제를 안에서 해결하고 사용자가 수신자 객체(즉,
self
)를 알아볼 수 있는 가
장 좋은 형태를 출력해야 한다.
__str__
(
)
,
__eq__
(
)
,
__bool__
(
)
메서드는
Vector2d
에서 전혀 바뀌지 않았으며,
frombytes(
)
메서드는 글자 하나만 바뀌었다
(
마지막 행에서
*
하나만 제거되었다
)
. 원래의
Vector2d
클래스를 반복형으로 만들었기 때문에 이렇게 쉽게 바꿀 수 있었다.
한편,
Vector
클래스가
Vector2d
클래스를 상속받도록 할 수도 있었지만, 두 가지 이유로 상
속받지 않았다. 첫째, 생성자가 호환되지 않으므로 상속받는 것은 좋지 않다. 사실,
__init__
()
에서 매개변수를 영리하게 처리하면 이 문제를 해결할 수 있다. 하지만
Vector
클래스가 시
퀀스 프로토콜을 구현하는 독자적인 예제가 되기를 원했다는 더 중요한 이유가 있었다. 이제
프로토콜이라는 ...
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