Books+ Search Results

Pro Python

Title
Pro Python / J. Burton Browning, Marty Alchin.
ISBN
9781484203347
1484203348
1484203356
9781484203354
9781484203354
Edition
Second edition.
Publication
[New York] : Apress, [2014]
Copyright Notice Date
©2014
Physical Description
1 online resource
Local Notes
Access is available to the Yale community.
Notes
Includes index.
Access and use
Access restricted by licensing agreement.
Summary
You?ve learned the basics of Python, but how do you take your skills to the next stage? Even if you know enough to be productive, there are a number of features that can take you to the next level in Python. Pro Python, Second Edition explores concepts and features normally left to experimentation, allowing you to be even more productive and creative. In addition to pure code concerns, Pro Python develops your programming techniques and approaches, which will help make you a better Python programmer. This book will improve not only your code but also your understanding and interaction with the many established Python communities. This book takes your Python knowledge and coding skills to the next level. It shows you how to write clean, innovative code that will be respected by your peers. With this book, make your code do more with introspection and meta-programming. And learn and later use the nuts and bolts of an application, tier-by-tier as a complex case study along the way. For more information, including a link to the source code referenced in the book, please visit http://propython.com.
Variant and related titles
O'Reilly Safari. OCLC KB.
Other formats
Printed edition:
Format
Books / Online
Language
English
Added to Catalog
January 14, 2020
Series
Expert's voice in Python.
The expert's voice in Python
Bibliography
Includes bibliographical references and index.
Contents
At a Glance
Contents
About the Authors
About the Technical Reviewer
Acknowledgments
Introduction
Chapter 1: Principles and Philosophy
The Zen of Python
Beautiful Is Better Than Ugly
Explicit Is Better Than Implicit
Simple Is Better Than Complex
Complex Is Better Than Complicated
Flat Is Better Than Nested
Sparse Is Better Than Dense
Readability Counts
Special Cases Aren't Special Enough to Break the Rules
Although Practicality Beats Purity
Errors Should Never Pass Silently
Unless Explicitly Silenced
In the Face of Ambiguity, Refuse the Temptation to Guess
There Should Be One-and Preferably Only One-Obvious Way to Do It
Although That Way May Not Be Obvious at First Unless You're Dutch
Now Is Better Than Never
Although Never Is Often Better Than Right Now
If the Implementation Is Hard to Explain, It's a Bad Idea
If the Implementation Is Easy to Explain, It May Be a Good Idea
Namespaces Are One Honking Great Idea-Let's Do More of Those!
Don't Repeat Yourself
Loose Coupling
The Samurai Principle
The Pareto Principle
The Robustness Principle
Backward Compatibility
The Road to Python 3.0
Taking It With You
Chapter 2: Advanced Basics
General Concepts
Iteration
Caching
Transparency
Control Flow
Catching Exceptions
Exception Chains
When Everything Goes Right
Proceeding Regardless of Exceptions
Optimizing Loops
The with Statement
Conditional Expressions
Iteration
Sequence Unpacking
List Comprehensions
Generator Expressions
Set Comprehensions
Dictionary Comprehensions
Chaining Iterables Together
Zipping Iterables Together
Collections
Sets
Named Tuples
Ordered Dictionaries
Dictionaries with Defaults
Importing Code
Fallback Imports
Importing from the Future.
Using __all __ to Customize Imports
Relative Imports
The __import__() function
The importlib module
Taking It With You
Chapter 3: Functions
Arguments
Planning for Flexibility
Variable Positional Arguments
Variable Keyword Arguments
Combining Different Kinds of Arguments
Invoking Functions with Variable Arguments
Preloading Arguments
Introspection
Example: Identifying Argument Values
Example: A More Concise Version
Example: Validating Arguments
Decorators
Closures
Wrappers
Decorators with Arguments
Decorators with-or without-Arguments
Example: Memoization
Example: A Decorator to Create Decorators
Function Annotations
Example: Type Safety
Factoring Out the Boilerplate
Example: Type Coercion
Annotating with Decorators
Example: Type Safety as a Decorator
Generators
Lambdas
Introspection
Identifying Object Types
Modules and Packages
Docstrings
Taking It with You
Chapter 4: Classes
Inheritance
Multiple Inheritance
Method Resolution Order
Example: C3 Algorithm
Using super() to Pass Control to Other Classes
Introspection
How Classes Are Created
Creating Classes at Runtime
Metaclasses
Example: Plugin Framework
Controlling the Namespace
Attributes
Properties
Descriptors
Methods
Unbound Methods
Bound Methods
Class Methods
Static Methods
Assigning Functions to Classes and Instances
Magic Methods
Creating Instances
Example: Automatic Subclasses
Dealing with Attributes
String Representations
Taking It With You
Chapter 5: Common Protocols
Basic Operations
Mathematical Operations
Bitwise Operations
Variations
Numbers
Sign Operations
Comparison Operations
Iterables
Example: Repeatable Generators
Sequences
Mappings
Callables.
Context Managers
Taking It With You
Chapter 6: Object Management
Namespace Dictionary
Example: Borg Pattern
Example: Self-Caching Properties
Garbage Collection
Reference Counting
Cyclical References
Weak References
Pickling
Copying
Shallow Copies
Deep Copies
Taking It With You
Chapter 7: Strings
Bytes
Simple Conversion: chr() and ord()
Complex Conversion: The Struct Module
Text
Unicode
Encodings
Simple Substitution
Formatting
Looking Up Values Within Objects
Distinguishing Types of Strings
Standard Format Specification
Example: Plain Text Table of Contents
Custom Format Specification
Taking It With You
Chapter 8: Documentation
Proper Naming
Comments
Docstrings
Describe What the Function Does
Explain the Arguments
Don't Forget the Return Value
Include Any Expected Exceptions
Documentation Outside the Code
Installation and Configuration
Tutorials
Reference Documents
Documentation Utilities
Formatting
Links
Sphinx
Taking It With You
Chapter 9: Testing
Test-Driven Development
Doctests
Formatting Code
Representing Output
Integrating With Documentation
Running Tests
The unittest Module
Setting Up
Writing Tests
Other Comparisons
Testing Strings and Other Sequence Content
Testing Exceptions
Testing Identity
Tearing Down
Providing a Custom Test Class
Changing Test Behavior
Taking It With You
Chapter 10: Distribution
Licensing
GNU General Public License
Affero General Public License
GNU Lesser General Public License
Berkeley Software Distribution License
Other Licenses
Packaging
setup.py
MANIFEST.in
The sdist Command
Distribution
Taking It With You
Chapter 11: Sheets: A CSV Framework
Building a Declarative Framework.
Introducing Declarative Programming
To Build or Not to Build?
Building the Framework
Managing Options
Defining Fields
Attaching a Field to a Class
Adding a Metaclass
Bringing It Together
Ordering Fields
DeclarativeMeta.__prepare__()
Column.__init__()
Column.__new__()
CounterMeta.__call__()
Choosing an Option
Building a Field Library
StringField
IntegerColumn
FloatColumn
DecimalColumn
DateColumn
Getting Back to CSV
Checking Arguments
Populating Values
The Reader
The Writer
Taking It With You
Appendix A: Style Guide for Python
Introduction
A Foolish Consistency Is the Hobgoblin of Little Minds
Code Layout
Indentation
Tabs or Spaces?
Maximum Line Length
Blank Lines
Encodings (PEP 263)
Imports
Whitespace in Expressions and Statements
Pet Peeves
Other Recommendations
Comments
Block Comments
Inline Comments
Documentation Strings
Version Bookkeeping
Naming Conventions
Descriptive: Naming Styles
Prescriptive: Naming Conventions
Names to Avoid
Package and Module Names
Class Names
Exception Names
Global Variable Names
Function Names
Function and Method Arguments
Method Names and Instance Variables
Constants
Designing for Inheritance
Programming Recommendations
Copyright
Appendix B: Voting Guidelines
Abstract
Rationale
Voting Scores
Copyright
Appendix C: The Zen of Python
Abstract
The Zen of Python
Easter Egg
Copyright
Appendix D: Docstring Conventions
Abstract
Rationale
Specification
What Is a Docstring?
One-Line Docstrings
Multiline Docstrings
Handling Docstring Indentation
Copyright
Acknowledgments
Appendix E: Backward Compatibility Policy
Abstract
Rationale
Backward Compatibility Rules.
Making Incompatible Changes
Copyright
Appendix F: Python 3000
Abstract
Naming
PEP Numbering
Timeline
Compatibility and Transition
Implementation Language
Meta-Contributions
Copyright
Appendix G: Python Language Moratorium
Abstract
Rationale
Details
Cannot Change
Case-by-Case Exemptions
Allowed to Change
Retroactive
Extensions
Copyright
Index.
Genre/Form
Handbooks and manuals.
Also listed under
Alchin, Marty, author.
Safari Books Online (Firm)
Citation

Available from:

Online
Loading holdings.
Unable to load. Retry?
Loading holdings...
Unable to load. Retry?