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판)
479
12
장
시퀀스 특별 메서드
여기서는 모든 속성이 아니라, 읽기 전용 속성
x
,
y
,
z
,
t
를 지원하면서 나머지 단일 소문자로
된 속성의 설정만 막으려 했음에 유의하라.
WARNING
클래스 수준에서
__slots__
를 정의하면 새로운 객체 속성을 생성할 수 없게 되므로, 여기서
구현한
__setattr__()
대신
__slots__
속성을 사용하고 싶을 것이다. 그러나
11
.
11
.
2
절 ‘
__slots__
문제점 정리’에서 설명했듯이, 단지 객체 속성의 생성을 막으려고
__slots__
를 사용하는 것은 권장하지 않
는다.
__slots__
는 정말로 문제가 있을 때만 메모리를 절약하기 위해 사용해야 한다.
Vector
요소에 저장하는 기능은 지원하지 않았지만, 이 예제에서 배울 중요한 내용이 있다. 객
체가 일관성 있게 작동하게 하려면
__getattr__(
)
을 구현할 때
__setattr__(
)
도 함께 구
현해야 한다는 것이다.
벡터 요소의 변경을 허용하고 싶다면
__setitem__(
)
메서드를 구현해서
v[0] = 1.1
의 형
태로,
__setattr__(
)
메서드를 구현해서
v.x = 1.1
로 작성할 수 있다. 그러나 다음 절에서
Vector
를 해시 가능하게 만들려고 하므로, 일단
Vector
는 불변형으로 놔두겠다.
12
.
7
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