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판)
232
1
부
데이터 구조체
로퍼티 게터
property
getter
로 생각하면 된다. 프로퍼티 게터는 인스턴스 속성을 가져오기 위해 명
시적으로
()
연산자를 호출하지 않아도 되는 메서드이다. 즉 여기서
a
와
b
는 읽기 전용 인스턴
스 속성으로 작동한다는 의미인데,
DemoNTClass
인스턴스는 단지 멋지게 만든 튜플이고, 튜플
은 불변형이라는 점을 생각하면 앞뒤가 맞는다. 그리고
DemoNTClass
는 사용자 정의된 독스트
링을 가져온다.
>>>
DemoNTClass.__doc__
‘DemoNTClass(a, b)’
이제
DemoNTClass
의 인스턴스를 살펴보자.
>>>
nt = DemoNTClass(8)
>>>
nt.a
8
>>>
nt.b
1.1
>>>
nt.c
‘spam’
nt
인스턴스를 만들려면 적어도
a
인수는
DemoNTClass
에 전달해야 한다. 생성자는
b
인수도
받지만, 기본값이
1.1
인 선택적인 값이다.
nt
객체에는 예상대로
a
와
b
속성이 있지만
c
속성
은 없다. 그러나 파이썬 객체가 그렇듯이 클래스에서 속성을 가져올 수 있다.
nt.a
,
nt.b
,
nt.c
, 심지어
nt.z
에 값을
할당해 보면 약간
다른 에러 메시지를
담은
AttributeError
예외가 발생한다. 직접 실행해 보고 메시지를 살펴보기를 바란다.
@
dataclass
로 어노테이트
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