Robust Python

Write Clean and Maintainable Code

Paperback Engels 2021 1e druk 9781098100667
€ 65,75
Levertijd ± 16 werkdagen
Gratis verzonden

Samenvatting

Does it seem like your Python projects are getting bigger and bigger? Are you feeling the pain as your codebase expands and gets tougher to debug and maintain? Python is an easy language to learn and use, but that also means systems can quickly grow beyond comprehension. Thankfully, Python has features to help developers overcome maintainability woes.

In this practical book, author Patrick Viafore shows you how to use Python's type system to the max. You'll look at user-defined types, such as classes and enums, and Python's type hinting system. You'll also learn how to make Python extensible and how to use a comprehensive testing strategy as a safety net. With these tips and techniques, you'll write clearer and more maintainable code.

- Learn why types are essential in modern development ecosystems
- Understand how type choices such as classes, dictionaries, and enums reflect specific intents
- Make Python extensible for the future without adding bloat
- Use popular Python tools to increase the safety and robustness of your codebase
- Evaluate current code to detect common maintainability gotchas
- Build a safety net around your codebase with linters and tests

Specificaties

ISBN13:9781098100667
Trefwoorden:Programmeren, Python
Taal:Engels
Bindwijze:paperback
Aantal pagina's:350
Uitgever:O'Reilly
Druk:1
Verschijningsdatum:27-7-2021
Hoofdrubriek:IT-management / ICT

Lezersrecensies

Wees de eerste die een lezersrecensie schrijft!

Inhoudsopgave

Preface
Who Should Read This Book
About This Book
Conventions Used in This Book
Using Code Examples
O’Reilly Online Learning
How to Contact Us
Acknowledgments

1. Introduction to Robust Python
Robustness
Why Does Robustness Matter?
What’s Your Intent?
Asynchronous Communication
Examples of Intent in Python
Collections
Iteration
Law of Least Surprise
Closing Thoughts

I: Annotating Your Code with Types
2. Introduction to Python Types
What’s in a Type?
Mechanical Representation
Semantic Representation
Typing Systems
Strong Versus Weak
Dynamic Versus Static
Duck Typing
Closing Thoughts

3. Type Annotations
What Are Type Annotations?
Benefits of Type Annotations
Autocomplete
Typecheckers
Exercise: Spot the Bug
When to Use Type Annotations
Closing Thoughts

4. Constraining Types
Optional Type
Union Types
Product and Sum Types
Literal Types
Annotated Types
NewType
Final Types
Closing Thoughts

5. Collection Types
Annotating Collections
Homogeneous Versus Heterogeneous Collections
TypedDict
Creating New Collections
Generics
Modifying Existing Types
As Easy as ABC
Closing Thoughts
Afgekapt op 59 regels

Managementboek Top 100

€ 65,75
Levertijd ongeveer 16 werkdagen
Gratis verzonden

Rubrieken

Producten

    Auteurs

      Trefwoorden

        Artikelen

          Robust Python