Professional Python

Professional Python
Автор книги: id книги: 822091     Оценка: 0.0     Голосов: 0     Отзывы, комментарии: 0 2818,71 руб.     (30,55$) Читать книгу Купить и читать книгу Купить бумажную книгу Электронная книга Жанр: Зарубежная образовательная литература Правообладатель и/или издательство: John Wiley & Sons Limited Дата добавления в каталог КнигаЛит: ISBN: 9781119070788 Возрастное ограничение: 0+ Оглавление Отрывок из книги

Реклама. ООО «ЛитРес», ИНН: 7719571260.

Описание книги

Master the secret tools every Python programmer needs to know Professional Python goes beyond the basics to teach beginner- and intermediate-level Python programmers the little-known tools and constructs that build concise, maintainable code. Design better architecture and write easy-to-understand code using highly adoptable techniques that result in more robust and efficient applications. Coverage includes Decorators, Context Managers, Magic Methods, Class Factories, Metaclasses, Regular Expressions, and more, including advanced methods for unit testing using asyncio and CLI tools. Each topic includes an explanation of the concept and a discussion on applications, followed by hands-on tutorials based on real-world scenarios. The "Python 3 first" approach covers multiple current versions, while ensuring long-term relevance. Python offers many tools and techniques for writing better code, but often confusing documentation leaves many programmers in the dark about how to use them. This book shines a light on these incredibly useful methods, giving you clear guidance toward building stronger applications. Learn advanced Python functions, classes, and libraries Utilize better development and testing tools Understand the "what," "when," "why," and "how" More than just theory or a recipe-style walk-through, this guide helps you learn – and understand – these little-known tools and techniques. You'll streamline your workflow while improving the quality of your output, producing more robust applications with cleaner code and stronger architecture. If you're ready to take your Python skills to the next level, Professional Python is the invaluable guide that will get you there.

Оглавление

Luke Sneeringer. Professional Python

Introduction

Who This Book Is For

What This Book Covers

How This Book Is Structured

What You Need to Use This Book

Conventions

Errata

p2p.wrox.com

Part I. Functions

Chapter 1. Decorators

Understanding Decorators

Decorator Syntax

Where Decorators Are Used

Why You Should Write Decorators

When You Should Write Decorators

Writing Decorators

Decorating Classes

Type Switching

Summary

Chapter 2. Context Managers

What Is a Context Manager?

Context Manager Syntax

When You Should Write Context Managers

A Simpler Syntax

Summary

Chapter 3. Generators

Understanding What a Generator Is

Understanding Generator Syntax

Communication with Generators

Iterables Versus Iterators

Generators in the Standard Library

When to Write Generators

When Are Generators Singletons?

Generators within Generators

Summary

Part II. Classes

Chapter 4. Magic Methods

Magic Method Syntax

Available Methods

Other Magic Methods

Summary

Chapter 5. Metaclasses

Classes and Objects

Writing Metaclasses

Using Metaclasses

When to Use Metaclasses

The Question of Explicit Opt-In

Meta-Coding

Summary

Chapter 6. Class Factories

A Review of type

Understanding a Class Factory Function

Determining When You Should Write Class Factories

Summary

Chapter 7. Abstract Base Classes

Using Abstract Base Classes

Declaring a Virtual Subclass

Declaring a Protocol

Built-in Abstract Base Classes

Summary

Part III. Data

Chapter 8. Strings and Unicode

Text String Versus Byte String

Strings with Non-ASCII Characters

Other Encodings

Reading Files

Reading Other Sources

Specifying Python File Encodings

Strict Codecs

Summary

Chapter 9. Regular Expressions

Why Use Regular Expressions?

Regular Expressions in Python

Basic Regular Expressions

Grouping

Lookahead

Flags

Substitution

Compiled Regular Expressions

Summary

Part IV. Everything Else

Chapter 10. Python 2 Versus Python 3

Cross-Compatibility Strategies

Changes in Python 3

Standard Library Relocations

Version Detection

Summary

Chapter 11. Unit Testing

The Testing Continuum

Testing Code

Unit Testing Frameworks

Mocking

Other Testing Tools

Summary

Chapter 12. CLI Tools

OPTPARSE

ARGPARSE

Summary

Chapter 13. asyncio

The Event Loop

Coroutines

Futures and Tasks

Callbacks

Task Aggregation

Queues

Servers

Summary

Chapter 14. Style

Principles

Standards

Summary

About the Author

About the Technical Editors

Credits

Acknowledgments

WILEY END USER LICENSE AGREEMENT

Отрывок из книги

This book introduces the reader to more advanced Python programming by providing an intermediate course in the Python language.

Recently, Python has become more and more frequently the developer's language of choice. It is used all over the world, for myriad purposes. As adoption continues to increase, more and more developers are spending their days writing Python.

.....

Running the error function in the Python interpreter gives you the following:

Note that only the JSONOutputError exception class (and any subclasses) receives this special handling. Any other exception is passed through normally, and generates a traceback. Consider this function:

.....

Добавление нового отзыва

Комментарий Поле, отмеченное звёздочкой  — обязательно к заполнению

Отзывы и комментарии читателей

Нет рецензий. Будьте первым, кто напишет рецензию на книгу Professional Python
Подняться наверх