Powerful Object-Oriented Programming
Mark Lutz

Python#
OOP#
syntax#
آموزش جامع و عمیق Python – نسخه ششم (Python 3.12)
اگر میخواهید پایتون را از پایه و بهصورت اصولی یاد بگیرید، این کتاب بهترین راهنما برای شماست. بر اساس دوره آموزشی محبوب مارک لاتز، این نسخهی بهروز شده به شما کمک میکند تا کدهای کارآمد و باکیفیت بنویسید، چه تازهکار باشید و چه توسعهدهندهای حرفهای در زبانهای دیگر.
چرا این کتاب؟
• آموزش از پایه تا پیشرفته – مناسب برای تمام سطوح
• تمرینها، کوییزها و تصاویر آموزشی برای یادگیری سریعتر
• پوشش کامل نسخه ۳.۱۲ و تمام نسخههای پرکاربرد Python
• تمرکز بر مفاهیم کلیدی و قابلیتهای جدید زبان
آنچه یاد میگیرید:
• آشنایی کامل با انواع دادههای داخلی پایتون (رشتهها، لیستها، دیکشنریها، فایلها و...)
• ساخت و پردازش آبجکتها با دستورات پایتون و یادگیری مدل نحوی زبان
• برنامهنویسی تابعی (Functional Programming) برای کدنویسی بهینه و جلوگیری از تکرار
• مدیریت پروژههای بزرگتر با ماژولها و پکیجها
• نوشتن برنامههای پایدار و بدون خطا با استفاده از مدیریت استثناها (Exception Handling)
• برنامهنویسی شیگرا (OOP) و استفاده از کلاسها برای سفارشیسازی کد
• بررسی ابزارهای پیشرفته پایتون مثل دکوریتورها (Decorators)، دیسکریپتورها (Descriptors) و متاکلاسها (Metaclasses)
• نوشتن کدهای پایتونیک و پرتابل که روی پلتفرمهای مختلف اجرا شود
Get a comprehensive, in-depth introduction to the core Python language with this hands-on book. Based on author Mark Lutz's popular training course, this updated sixth edition will help you quickly write efficient, high-quality code with Python. It's an ideal way to begin, whether you're new to programming or a professional developer versed in other languages.
Complete with quizzes, exercises, and helpful illustrations, this easy-to-follow self-paced tutorial gets you started with Python 3.12 and all other releases in use today. With a pragmatic focus on what you need to know, it also introduces some advanced language features that have become increasingly common in Python code.
This book helps you:
Why this Book?
This book is a tutorial on the Python language and a classic in its domain. It’s the product of three decades spent using, promoting, and teaching Python, and dates back to the mid-1990s, when Python was still at version 1.X, and the web was just something developers mused about over lunch. Although the focus here is firmly on the present, that legacy naturally adds some historical context that will help you understand Python more deeply. Despite what you may have heard, the past matters, especially in knowledge-based fields.
Just as importantly, this book has always been based on live-and-in-person feedback from Python beginners struggling to learn Python for the first time. This feedback mostly owes to Python training classes taught over a period of two decades. While these classes have now gone the way of the dodo and Yahoo, this book takes care to retain its learner-inspired material because that’s much—if not most—of its value.
As a result, if you’re like most of the thousands of learners whose experiences have been captured here, you’ll probably find that this book works like a self-paced version of the Python training sessions from which it arose. You may sometimes even find that it answers your questions before they are asked because a host of learners before you have had the same queries. This isn’t clairvoyance; it simply reflects the fact that learning resources do best when they listen to learners.
It’s also worth noting up front that this book sometimes critiques Python changes while presenting them. Critical thinking is crucial in engineering domains—especially in one caught up in an arms race that convolutes tools used by millions of people. On some levels, Python remains a constantly morphing sandbox of ideas that too often prioritizes changer hubris over user need, and this book is not shy about calling this out. That said, the main goal here is to educate, not criticize, and opinions are always, well, opinionated. Although views here reflect decades of using and teaching Python, you should always judge the net worth of Python changes for yourself in whatever world you’ve been cast.
Changes in the sixth edition:
This edition drops coverage of the now-sunsetted Python 2.X line and updates its content to be current with Python 3.12 and the decade of changes since its prior edition. It also gives more focus to non-Windows platforms, including smartphones. Among its new 3.X content, this edition covers f-string literals, named-assignment expressions, match statements, type hinting, async coroutines, underscore digit separators, exception groups, module attribute hooks, star-unpacking proliferation, main-script package files, dictionary-key insertion order, positional-only function arguments, hash-based bytecode files, and other additions, deprecations, and changes.
Other noteworthy changes this time around:
Table of Contents
Part I. Getting Started
Chapter 1. A Python Q&A Session
Chapter 2. How Python Runs Programs
Chapter 3. How You Run Programs
Part II. Objects and Operations
Chapter 4. Introducing Python Objects
Chapter 5. Numbers and Expressions
Chapter 6. The Dynamic Typing Interlude
Chapter 7. String Fundamentals
Chapter 8. Lists and Dictionaries
Chapter 9. Tuples, Files, and Everything Else
Part III. Statements and Syntax
Chapter 10. Introducing Python Statements
Chapter 11. Assignments, Expressions, and Prints
Chapter 12. if and match Selections
Chapter 13. while and for Loops
Chapter 14. Iterations and Comprehensions
Chapter 15. The Documentation Interlude
Part IV. Functions and Generators
Chapter 16. Function Basics
Chapter 17. Scopes
Chapter 18. Arguments
Chapter 19. Function Odds and Ends
Chapter 20. Comprehensions and Generations
Chapter 21. The Benchmarking Interlude
Part V. Modules and Packages
Chapter 22. Modules: The Big Picture
Chapter 23. Module Coding Basics
Chapter 24. Module Packages
Chapter 25. Module Odds and Ends
Part VI. Classes and OOP
Chapter 26. OOP: The Big Picture
Chapter 27. Class Coding Basics
Chapter 28. A More Realistic Example
Chapter 29. Class Coding Details
Chapter 30. Operator Overloading
Chapter 31. Designing with Classes
Chapter 32. Class Odds and Ends
Part VII. Exceptions
Chapter 33. Exception Basics
Chapter 34. Exception Coding Details
Chapter 35. Exception Objects
Chapter 36. Exception Odds and Ends
Part VIII. Advanced Topics
Chapter 37. Unicode and Byte Strings
Chapter 38. Managed Attributes
Chapter 39. Decorators
Chapter 40. Metaclasses and Inheritance
Chapter 41. All Good Things
Part IX. Appendices
Appendix A. Platform Usage Tips
Appendix B. Solutions to End-of-Part Exercises
About the Author
Mark Lutz is the author of Python's classic and foundational texts, a former trainer with two decades of experience teaching Python to newcomers, and one of the people responsible for the prominence that Python enjoys today.
Mark wrote the three O'Reilly books Learning Python, Programming Python, and Python Pocket Reference, all currently in fourth, fifth, or sixth editions. He has been using and promoting Python since 1992, started writing Python books in 1995, and began teaching Python classes in 1997.
All told, Mark has taught thousands of learners live and in person, and his published works span 12k pages among 15 books that cover Pythons 1.X through 3.X. He also has BS and MS degrees in computer science, work experience in compilers and other domains, and a current interest in Python-coded apps that run on both PCs and phones.









