Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Python 2E

You're reading from   Mastering Python 2E Write powerful and efficient code using the full range of Python's capabilities

Arrow left icon
Product type Paperback
Published in May 2022
Last Updated in May 2022
Publisher Packt
ISBN-13 9781800207721
Length 710 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Rick Hattem Rick Hattem
Author Profile Icon Rick Hattem
Rick Hattem
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Getting Started – One Environment per Project 2. Interactive Python Interpreters FREE CHAPTER 3. Pythonic Syntax and Common Pitfalls 4. Pythonic Design Patterns 5. Functional Programming – Readability Versus Brevity 6. Decorators – Enabling Code Reuse by Decorating 7. Generators and Coroutines – Infinity, One Step at a Time 8. Metaclasses – Making Classes (Not Instances) Smarter 9. Documentation – How to Use Sphinx and reStructuredText 10. Testing and Logging – Preparing for Bugs 11. Debugging – Solving the Bugs 12. Performance – Tracking and Reducing Your Memory and CPU Usage 13. asyncio – Multithreading without Threads 14. Multiprocessing – When a Single CPU Core Is Not Enough 15. Scientific Python and Plotting 16. Artificial Intelligence 17. Extensions in C/C++, System Calls, and C/C++ Libraries 18. Packaging – Creating Your Own Libraries or Applications 19. Other Books You May Enjoy
20. Index

To get the most out of this book

Depending on your level of experience you should start reading from the beginning, or gloss over the chapters to skip to sections that are interesting for you. This book is suitable for intermediate to expert level Python programmers, but not all sections will be equally useful for everyone.

As an example, the first two chapters are about setting up your environment and Python interpreter and seem like chapters you can skip entirely as an advanced or expert Python programmer, but I would advise against fully skipping them, as a few useful utilities and libraries are covered which you might not be familiar with.

The chapters of this book do build on each other to a certain degree, but there is no strict reading order and you can easily cherry-pick the parts you wish to read. If there is a reference to an earlier chapter, it is clearly indicated.

The most up-to-date version of the code samples can always be found at https://github.com/mastering-python/code_2.

The code in this repository is automatically tested and, if you have any suggestions, pull requests are always welcome.

Most chapters of this book also include exercises at the end that will allow you to test what you have learned. Since there are always multiple solutions to problems, you, and every other reader of this book, can submit and compare your solutions on GitHub: https://github.com/mastering-python/exercises

You are encouraged to create a pull request with your solution to the problems. And you can learn from others here as well, of course.

Download the example code files

The code bundle for the book is hosted on GitHub at https://github.com/mastering-python/code_2 and pull requests with improvements are welcome. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781800207721_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

While this book largely adheres to the PEP8 styling conventions, there are a few concessions made due to the space limitations of a book format. Simply put, code samples that span multiple pages are hard to read, so some parts use less whitespace than you would usually expect. The full version of the code is available on GitHub and is automatically tested to be PEP8-compliant.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: “The itertools.chain() generator is one of the simplest yet one of the most useful generators in the Python library.”

A block of code is set as follows:

from . import base

class A(base.Plugin):
    pass

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

   :show-inheritance:
   :private-members:
   :special-members:
   :inherited-members:

Any command-line input or output is written as follows:

$ pip3 install -U mypy

Bold: Indicates a new term, an important word, or words that you see on the screen, for example, in menus or dialog boxes. For example: “Sometimes interactive interpreters are referred to as REPL. This stands for Read-Eval-Print-Loop.”

Warnings or important notes appear like this.

Tips and tricks appear like this.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image