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판)
1032
5
부
메타프로그래밍
type.__new__(
)
를 실행하기 전에
cls_dict
에 추가해야 하는 속성 중의 하나가
__slots__
다(
24
.
5
.
1
절 ‘
__init_subclass__
(
)
가
__slots__
를 설정하지 못하는 이유’ 참조
)
. 메타클
래스의
__new__(
)
메서드는
__slots__
를 설정하는 이상적인 곳이다. 다음 절에서 이를 설정
하는 방법을 설명한다.
24
.
8
.
2
멋진 메타클래스 사례
여기에 나온
MetaBunch
메타클래스는 파이썬
2
.
7
과
3
.
5
에서 실행되도록 만들어진 『
Python
in
a
Nutshell
:
A
Desktop
Quick
Reference
,
3rd
Ed
.』
(
오라일리,
2017
)
의
4
장에 나오는
마지막 예제를 변형한 것이다.
14
파이썬
3
.
6
+에서 실행한다고 가정해 코드를 더 간단하게 만
들 수 있었다.
먼저 베이스 클래스
Bunch
가 제공하는 기능을 보자.
>>>
class Point(Bunch):
...
x = 0.0
...
y = 0.0
...
color = ‘gray’
...
>>>
Point(x=1.2, y=3, color=’green’)
Point(x=1.2, y=3, color=’green’)
>>>
p = Point()
>>>
p.x, p.y, p.color
(0.0, 0.0, ‘gray’) ...
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