Clear, Concise, and Effective Programming
Luciano Ramalho

#Python
#Fluent
#patterns
#quickly
#Data_structures
#design_patterns
#effective
#Unicode
🐍 این کتاب به شما کمک میکند تا از تمام قابلیتهای زبان Python 3 استفاده کنید و کدهایی مؤثر، مدرن و خوانا بنویسید. نویسنده، لوچیانو رامالو، شما را با ویژگیهای اصلی زبان و کتابخانههای پایتون آشنا میکند و نشان میدهد چگونه کدتان کوتاهتر، سریعتر و قابل فهمتر باشد.
⚡ ویژگیهای کلیدی ویرایش جدید:
📖 فهرست مطالب
بخش اول: ساختار دادهها
بخش دوم: توابع بهعنوان اشیاء
7. توابع بهعنوان اشیاء کلاس اول
8. تایپ هینتها در توابع
9. دکوراتورها و کلوزرها
10. الگوهای طراحی با توابع کلاس اول
بخش سوم: کلاسها و پروتکلها
11. یک شیء پایتونیک
12. متدهای ویژه برای دنبالهها
13. اینترفیسها، پروتکلها و ABCها
14. ارثبری: خوب یا بد
15. بیشتر درباره تایپ هینتها
16. بارگذاری عملگرها
بخش چهارم: کنترل جریان
17. تکرارگرها، ژنراتورها و کوروتینهای کلاسیک
18. with، match و بلوکهای else
19. مدلهای همزمانی در پایتون
20. اجراییهای همزمان
21. برنامهنویسی آسنکرون
بخش پنجم: متاپروگرامینگ
22. ویژگیها و Attributeهای پویا
23. دسکریپتورهای Attribute
24. متاپروگرامینگ کلاس
📌 مقدمه کتاب:
پایتون زبان قدرتمند و آسان برای یادگیری است، اما بسیاری از برنامهنویسان فقط بخش کوچکی از قابلیتهای آن را استفاده میکنند. این کتاب به جای ارائه مرجع کامل A تا Z، بر ویژگیهایی تمرکز دارد که یا منحصربهفرد پایتون هستند یا در بسیاری از زبانهای محبوب دیگر یافت نمیشوند.
👨💻 مخاطبان کتاب:
این کتاب برای برنامهنویسانی نوشته شده که میخواهند در پایتون 3 مهارت پیدا کنند و با نسخههای 3.8 تا 3.10 تست شده است.
🚫 این کتاب مناسب چه کسانی نیست؟
اگر تازهکار پایتون هستید، دنبال کردن این کتاب دشوار خواهد بود و ممکن است این تصور را بدهد که هر اسکریپت پایتون باید از متدهای ویژه و متاپروگرامینگ استفاده کند.
👤 درباره نویسنده:
لوچیانو رامالو مشاور ارشد در ThoughtWorks و عضو بنیاد پایتون است. او از سال 1998 بهطور حرفهای از پایتون استفاده کرده و در بزرگترین وبسایتها و موسسات مالی و دولتی برزیل پروژه اجرا کرده است. رامالو در شش کشور سخنرانی و آموزش پایتون داشته و صاحب مشترک Python.pro.br است، یک شرکت آموزش پایتون.
Don't waste time bending Python to fit patterns you've learned in other languages. Python's simplicity lets you become productive quickly, but often this means you aren't using everything the language has to offer. With the updated edition of this hands-on guide, you'll learn how to write effective, modern Python 3 code by leveraging its best ideas.
Discover and apply idiomatic Python 3 features beyond your past experience. Author Luciano Ramalho guides you through Python's core language features and libraries and teaches you how to make your code shorter, faster, and more readable.
Complete with major updates throughout, this new edition features five parts that work as five short books within the book:
Table of Contents
Part I. Data Structures
Chapter 1. The Python Data Model
Chapter 2. An Array of Sequences
Chapter 3. Dictionaries and Sets
Chapter 4. Unicode Text Versus Bytes
Chapter 5. Data Class Builders
Chapter 6. Object References, Mutability, and Recycling
Part II. Functions as Objects
Chapter 7. Functions as First-Class Objects
Chapter 8. Type Hints in Functions
Chapter 9. Decorators and Closures
Chapter 10. Design Patterns with First-Class Functions
Part III. Classes and Protocols
Chapter 11. A Pythonic Object
Chapter 12. Special Methods for Sequences
Chapter 13. Interfaces, Protocols, and ABCs
Chapter 14. Inheritance: For Better or for Worse
Chapter 15. More About Type Hints
Chapter 16. Operator Overloading
Part IV. Control Flow
Chapter 17. Iterators, Generators, and Classic Coroutines
Chapter 18. with, match, and else Blocks
Chapter 19. Concurrency Models in Python
Chapter 20. Concurrent Executors
Chapter 21. Asynchronous Programming
Part V. Metaprogramming
Chapter 22. Dynamic Attributes and Properties
Chapter 23. Attribute Descriptors
Chapter 24. Class Metaprogramming
From the Preface
“Python is an easy to learn, powerful programming language.” Those are the first words of the official Python 3.10 tutorial. That is true, but there is a catch: because the language is easy to learn and put to use, many practicing Python programmers leverage only a fraction of its powerful features.
An experienced programmer may start writing useful Python code in a matter of hours. As the first productive hours become weeks and months, a lot of developers go on writing Python code with a very strong accent carried from languages learned before. Even if Python is your first language, often in academia and in introductory books it is presented while carefully avoiding language-specific features.
As a teacher introducing Python to programmers experienced in other languages, I see another problem that this book tries to address: we only miss stuff we know about. Coming from another language, anyone may guess that Python supports regular expressions, and look that up in the docs. But if you’ve never seen tuple unpacking or descriptors before, you will probably not search for them, and you may end up not using those features just because they are specific to Python.
This book is not an A-to-Z exhaustive reference of Python. Its emphasis is on the language features that are either unique to Python or not found in many other popular languages. This is also mostly a book about the core language and some of its libraries. I will rarely talk about packages that are not in the standard library, even though the Python package index now lists more than 60,000 libraries, and many of them are incredibly useful.
Who This Book Is For
This book was written for practicing Python programmers who want to become proficient in Python 3. I tested the examples in Python 3.10—most of them also in Python 3.9 and 3.8. When an example requires Python 3.10, it should be clearly marked.
If you are not sure whether you know enough Python to follow along, review the topics of the official Python tutorial. Topics covered in the tutorial will not be explained here, except for some features that are new.
Who This Book Is Not For
If you are just learning Python, this book is going to be hard to follow. Not only that, if you read it too early in your Python journey, it may give you the impression that every Python script should leverage special methods and metaprogramming tricks. Premature abstraction is as bad as premature optimization.
Luciano Ramalho is a Principal Consultant at ThoughtWorks and a fellow of the Python Software Foundation. He's been using Python professionally since 1998, deploying it in some of the largest Internet properties based in Brazil, as well as financial and government institutions. Ramalho has presented Python talks and tutorials in six countries, including events like PyCon US, OSCON, Python Brasil, PyBay, and PyCaribbean. He is co-owner of Python.pro.br, a training company.









