Of course. Here is a detailed overview of "Core Python Programming, Second Edition" by Wesley Chun, specifically focusing on the English version.

This book is a classic and highly respected resource in the Python community, especially for developers who want to move beyond basic syntax and understand the language's deeper mechanics.
Core Python Programming, Second Edition (English)
About the Book
- Author: Wesley J. Chun
- Publisher: Prentice Hall
- Publication Date: 2006 (This is important to note for its relevance to modern Python)
- Target Audience: Intermediate to advanced developers. It's not for absolute beginners who have never programmed before. It's ideal for:
- Programmers familiar with other languages (like C++, Java, C#, Perl) who want to learn Python thoroughly.
- Python programmers who want to deepen their understanding of the language's core features, "Pythonic" idioms, and internals.
- Students and professionals who need a comprehensive reference for Python 2.x.
Key Strengths
This book is famous for several reasons:
- Comprehensive and In-Depth: It lives up to its name "Core Python." It covers a vast amount of the standard library and language features in great detail. It doesn't just show you what a feature does, but how it works under the hood.
- "Pythonic" Approach: Chun emphasizes writing code that is not just functional, but also readable, maintainable, and efficient—the "Pythonic" way. This includes teaching best practices, common idioms, and design patterns specific to Python.
- Excellent Examples: The book is filled with practical, well-explained code examples. The examples are non-trivial and demonstrate real-world applications of the concepts being taught.
- Clear Explanations: Complex topics like decorators, metaclasses, and descriptors are broken down into understandable language. Chun has a talent for making the abstract concrete.
- Strong Coverage of Python 2.x: As a book from the mid-2000s, it is an authoritative guide to Python 2.x. If you are working on legacy systems or need to understand Python 2 code, this book is an invaluable resource.
Content Overview (Table of Contents Style)
The book is structured logically, starting from the basics and moving to more advanced topics.
-
Part I: The Core Language
(图片来源网络,侵删)- Welcome to Python: A quick overview.
- Quick Python Tour: A high-level look at the language's features.
- The Absolute Basics: Variables, data types, operators, and basic I/O.
- Lists, Tuples, and Dictionaries: Deep dives into Python's fundamental data structures.
- Conditionals and Loops: Control flow.
- Strings: Text handling, methods, and formatting.
- Functions: Defining, calling, arguments, return values, scope, and lambda functions.
- Modules and Packages: Organizing code,
importmechanisms, and creating your own modules. - Exceptions: Error handling and best practices.
- Object-Oriented Programming (OOP): Classes, objects, inheritance, polymorphism, and special methods (
__init__,__str__, etc.). - Execution Environment: A look at how Python code is executed, including the distinction between scripts and modules.
-
Part II: Advanced Topics
- Execution Environment: More on how Python works.
- Data Types: A more advanced look at numbers, sequences, and mappings.
- Dynamic Functions and Attributes: Dynamically creating functions and attributes at runtime.
- Operators and Expressions: Overloading operators, slicing, and the
withstatement. - Regular Expressions: A comprehensive guide to the
remodule. - Execution Environment: Even deeper into Python's execution model.
- The
osandsysModules: Interacting with the operating system and the Python interpreter. - File and I/O Operations: Reading from and writing to files, and handling different encodings.
- The
pickleandshelveModules: Serialization and persistent storage. - The
dbmFamily: Database management interfaces. - Python and Internet Clients: Sockets, email handling (
smtplib,poplib,imaplib), and an introduction to XML processing. - Threading, Processes, and Networking: A look at concurrent programming (though the threading model is specific to Python 2's Global Interpreter Lock).
- User Interfaces: Brief coverage of Tkinter and web programming (CGI).
- Web Clients and Servers: More advanced topics like
urllib2,xmlrpclib, andSimpleXMLRPCServer. - Extending and Embedding Python: Using C/C++ to create Python extensions or embed Python in other applications.
- Packaging and Documentation: How to create and distribute your own Python packages and write good documentation.
Important Consideration: Python 2 vs. Python 3
This is the most critical point to understand about this book.
-
It is a Python 2.x book. All examples, syntax, and explanations are for Python 2. This means:
printis a statement, not a function (print "hello", notprint("hello")).- Integer division behavior differs (
3 / 2is1). - Unicode handling is different (strings are bytes by default).
- Many standard library modules have been reorganized or replaced in Python 3.
-
Is it still useful today?
- Yes, but with caveats. The core concepts of Python (data structures, OOP, functions, exceptions) are still 100% relevant. Understanding these deeply is more important than knowing the exact syntax of a specific version.
- It's an excellent book for learning the philosophy and structure of the language.
- It is essential for anyone maintaining legacy Python 2 codebases.
- If you are a complete beginner, it might be better to start with a modern Python 3 book to avoid getting confused by version-specific syntax. However, if you already know another language, the differences are minor and easy to pick up.
Where to Find It
- Purchase: You can often find new or used copies for sale on online retailers like Amazon or AbeBooks. It's a relatively old book, so new copies are rare, but used ones are plentiful and inexpensive.
- Legally Free: Wesley Chun made the first edition of the book legally available for free on his website. While this isn't the second edition, the first edition is still a very good resource and covers most of the core concepts. A quick search for "Core Python Programming Wesley Chun PDF" will lead you to it.
- Libraries: University and public libraries may have physical copies.
Conclusion
Core Python Programming, Second Edition is a fantastic book that has stood the test of time. It provides a deep, comprehensive, and well-structured tour of the Python language.
Recommendation:
- For learning Python 2: It's one of the best books available.
- For learning modern Python 3: Use it to understand the core concepts, but supplement it with a modern Python 3 book (like Fluent Python by Luciano Ramalho or the official Python Tutorial) to learn the current syntax and best practices. It's an excellent "second book" on Python.
