3 options
Secret recipes of the Python Ninja : over 70 recipes that uncover powerful programming tactics in Python / Cody Jackson.
- Format:
- Book
- Author/Creator:
- Jackson, Cody, author.
- Language:
- English
- Subjects (All):
- Python (Computer program language).
- Physical Description:
- 1 online resource (380 pages)
- Edition:
- 1st edition
- Place of Publication:
- Birmingham ; Mumbai : Packt Publishing, [2018]
- System Details:
- text file
- Summary:
- Test your Python programming skills by solving real-world problems About This Book Access built-in documentation tools and improve your code. Discover how to make the best use of decorator and generator functions Enhance speed and improve concurrency by conjuring tricks from the PyPy project Who This Book Is For Whether you've been working with Python for a few years or you're a seasoned programmer, you'll have a lot of new tricks to walk away with. What You Will Learn Know the differences between .py and .pyc files Explore the different ways to install and upgrade Python packages Understand the working of the PyPI module that enhances built-in decorators See how coroutines are different from generators and how they can simulate multithreading Grasp how the decimal module improves floating point numbers and their operations Standardize sub interpreters to improve concurrency Discover Python's built-in docstring analyzer In Detail This book covers the unexplored secrets of Python, delve into its depths, and uncover its mysteries. You'll unearth secrets related to the implementation of the standard library, by looking at how modules actually work. You'll understand the implementation of collections, decimals, and fraction modules. If you haven't used decorators, coroutines, and generator functions much before, as you make your way through the recipes, you'll learn what you've been missing out on. We'll cover internal special methods in detail, so you understand what they are and how they can be used to improve the engineering decisions you make. Next, you'll explore the CPython interpreter, which is a treasure trove of secret hacks that not many programmers are aware of. We'll take you through the depths of the PyPy project, where you'll come across several exciting ways that you can improve speed and concurrency. Finally, we'll take time to explore the PEPs of the latest versions to discover some interesting hacks. Style and approach Recipe based approach where each problem is solved with the help of step by step instructions.
- Contents:
- Cover
- Title Page
- Copyright and Credits
- Packt Upsell
- Foreword
- Contributors
- Table of Contents
- Preface
- Chapter 1: Working with Python Modules
- Introduction
- Using and importing modules and namespaces
- How to do it...
- How it works...
- There's more...
- Implementing virtual Python environments
- Getting ready
- Python package installation options
- Utilizing requirement files and resolving conflicts
- Using local patches and constraint files
- Working with packages
- Creating wheels and bundles
- Comparing source code to bytecode
- How to create and reference module packages
- Operating system-specific binaries
- How to upload programs to PyPI
- Project packaging
- Uploading to PyPI
- Chapter 2: Utilizing the Python Interpreter
- Launching Python environments
- Utilizing Python command options
- Interface options
- Generic options
- Miscellaneous options
- See also...
- Working with environment variables
- Making scripts executable
- Modifying interactive interpreter startup
- See also.
- Alternative Python implementations
- Installing Python on Windows
- Using the Windows Python launcher
- Embedding Python with other applications
- Using alternative Python shells - IPython
- Using alternative Python shells - bpython
- Using alternative Python shells - DreamPie
- Chapter 3: Working with Decorators
- Reviewing functions
- Introducing decorators
- Using function decorators
- Using class decorators
- Examples of decorators
- Using the decorators module
- See also
- Chapter 4: Using Python Collections
- Reviewing containers
- Lists and tuples
- Dictionaries
- Sets
- Implementing namedtuple
- Implementing deque
- Implementing ChainMap
- Implementing Counters
- Implementing OrderedDict
- Implementing defaultdict
- Implementing UserDict
- Implementing UserList
- Implementing UserString
- Improving Python collections
- Default dictionaries
- Named tuples
- Ordered dictionaries
- Looking at the collections - extended module
- Getting ready.
- How to do it...
- setlist
- bags
- RangeMap
- Bijection
- Chapter 5: Generators, Coroutines, and Parallel Processing
- How iteration works in Python
- Using the itertools module
- Infinite iterators
- Combinatoric iterators
- Terminating iterators
- Using generator functions
- Simulating multithreading with coroutines
- When to use parallel processing
- Forking processes
- How to implement multithreading
- Advantages
- Disadvantages
- How to implement multiprocessing
- Chapter 6: Working with Python's Math Module
- Using the math module's functions and constants
- Working with complex numbers
- Improving decimal numbers
- Increasing accuracy with fractions
- Working with random numbers
- Using the secrets module
- Implementing basic statistics
- Improving functionality with comath
- Chapter 7: Improving Python Performance with PyPy
- What is PyPy?
- What is RPython?
- Flow restrictions
- Object restrictions
- Integer types
- Some real-world examples
- Chapter 8: Python Enhancement Proposals
- What are PEPs?
- PEP 556 - Threaded garbage collection
- PEP 554 - Multiple subinterpreters.
- Channels
- PEP 551 - Security transparency
- General security
- Python and security
- PEP 543 - Unified TLS API
- Chapter 9: Documenting with LyX
- Python documentation tools and techniques
- Inline comments and the dir command
- Using docstrings
- Using PyDoc help
- HTML reports
- Using reStructuredText files
- Using the Sphinx documentation program
- Using LaTeX and LyX document preparation programs
- Other Books You May Enjoy
- Index.
- Notes:
- Description based on print version record.
- OCLC:
- 1038494970
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.