ENGLISH

Python Tricks: A Buffet of Awesome Python Features

Book information

Year
2017
ISBN
9781775093305, 9781775093312
Language
english
Format
PDF
Filesize
1 MB (1367370 bytes)
Edition
1
Pages
301\299
Time added
2020-06-01 16:44:37

Description

Contents Foreword Introduction What's a Python Trick? What This Book Will Do for You How to Read This Book Patterns for Cleaner Python Covering Your A** With Assertions Complacent Comma Placement Context Managers and the with Statement Underscores, Dunders, and More A Shocking Truth About String Formatting The Zen of Python Easter Egg Effective Functions Python's Functions Are First-Class Lambdas Are Single-Expression Functions The Power of Decorators Fun With *args and **kwargs Function Argument Unpacking Nothing to Return Here Classes & OOP Object Comparisons: is vs == String Conversion (Every Class Needs a __repr__) Defining Your Own Exception Classes Cloning Objects for Fun and Profit Abstract Base Classes Keep Inheritance in Check What Namedtuples Are Good For Class vs Instance Variable Pitfalls Instance, Class, and Static Methods Demystified Common Data Structures in Python Dictionaries, Maps, and Hashtables Array Data Structures Records, Structs, and Data Transfer Objects Sets and Multisets Stacks (LIFOs) Queues (FIFOs) Priority Queues Looping & Iteration Writing Pythonic Loops Comprehending Comprehensions List Slicing Tricks and the Sushi Operator Beautiful Iterators Generators Are Simplified Iterators Generator Expressions Iterator Chains Dictionary Tricks Dictionary Default Values Sorting Dictionaries for Fun and Profit Emulating Switch/Case Statements With Dicts The Craziest Dict Expression in the West So Many Ways to Merge Dictionaries Dictionary Pretty-Printing Pythonic Productivity Techniques Exploring Python Modules and Objects Isolating Project Dependencies With Virtualenv Peeking Behind the Bytecode Curtain Closing Thoughts Free Weekly Tips for Python Developers PythonistaCafe: A Community for Python Developers

Similar books