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판)
689
17
장
반복자, 제너레이터, 고전적인 코루틴
를 생성한다. 그러므로
SentenceIterator
클래스는 더는 필요 없다.
두 번째
Sentence
버전은 첫 번째 버전보다 훨씬 짧지만, 그리 느긋하지는 않다. 요즘에는 게
으른 듯한 느긋함이 적어도 프로그래밍 언어와
API
에서만큼은 좋은 성질이라고 여겨진다. 느
긋한 구현은 가능한 한 최후의 순간까지 값 생산을 미룬다. 느긋하게 계산함으로써 메모리를
줄일 수 있을 뿐만 아니라 불필요한
CPU
자원 낭비도 피할 수 있다.
다음 절에서는 느긋하게 작동하는
Sentence
클래스를 만들어 보자.
17
.
6
느긋한
Sentence
Sentence
의 마지막 버전은
re
모듈의 느긋한 함수를 활용해 느긋하게 작동한다.
17
.
6
.
1
Sentence
버전 #
4
: 느긋한 제너레이터
Iterator
인터페이스는 느긋하게 처리하도록 설계되었다.
next
(
my_iterator
)
는 한 번에
한 항목만 생성한다. 느긋한 계산법의 반대는 조급한 계산법
eager
evaluation
이며, 둘 다 프로그래밍
언어 이론에서 실제로 사용되는 기술 용어다.
지금까지 구현한
Sentence
는 느긋한 버전이 아니었다.
__init__(
)
에서 텍스트 안에 있는 단
어들의 리스트를 조급하게 생성해서
self.words
속성에 바인딩하기 때문이다. 그러므로 전체
텍스트를 처리해야 하며, 리스트는 거의 텍스트와 맞먹는 양의 메모리를 소비한다
(
텍스트 안
에 비단어 문자가 얼마나 있느냐에 따라 메모리를 더 많이 소비할 수도 있다
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