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판)
548
3
부
클래스와 프로토콜
❶
float
반환 어노테이션이 필요하다. 반환형이 없으면
Mypy
는
Any
로 간주하고 메서드 본체를 들여다보
지 않는다.
❷ 어노테이션이 없어도
Mypy
는 이 메서드가
complex
를 반환할 것이라고 추론할 수 있다. 설정에 따라
Mypy
가 경고 메시지를 출력할 수 있는데, 이 어노테이션은 경고 메시지가 출력되지 않게 한다.
❸ 여기서
SupportsComplex
는
datum
을
complex
로 변환할 수 있음을 보장한다.
❹ 명시적 변환이 필요하다.
SupportsComplex
은 바로 다음 줄에서 사용되는
real
과
imag
속성을 선언하
지 않기 때문이다.
Vector2d
는 이 속성들이 없지만,
__
complex
__(
)
를 구현한다.
모듈의 시작 부분에
from __future__ import annotations
가 있다면
fromcomplex(
)
의
반환형이
Vector2d
가 될 수 있다. 이 임포트 명령은 자료형 힌트를 문자열로 저장하게 해서 함
수 정의가 임포트 시에 평가되지 않게 한다.
annotations
의
__future__
임포트가 없으면, 아
직 클래스 정의가 완료되지 않았으므로
fromcomplex(
)
를 정의하는 시점까지는
Vector2d
에
대한 참조가 허용되지 않는다. 따라서 전방 참조
forward
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