

Alex Martelli spent 8 years with IBM Research, then 13 at think3 inc., followed by 4 years as a consultant (mostly for AB Strakt in Göteborg, Sweden), and lately 12 years at Google (currently as tech lead of 1:many tech support for Google Cloud Platform).
Meer over de auteursPython - In a Nutshell
A Desktop Quick Reference
Samenvatting
Python was recently ranked as today's most popular programming language on the TIOBE index, thanks to its broad applicability to design and prototyping to testing, deployment, and maintenance. With this updated fourth edition, you'll learn how to get the most out of Python, whether you're a professional programmer or someone who needs this language to solve problems in a particular field.
Carefully curated by recognized experts in Python, this new edition focuses on version 3.10, bringing this seminal work on the Python language fully up to date on five version releases, including preview coverage of upcoming 3.11 features.
This handy guide will help you:
- Learn how Python represents data and program as objects
- Understand the value and uses of type annotations
- Examine which language features appeared in which recent versions
- Discover how to use modern Python idiomatically
- Learn ways to structure Python projects appropriately
- Understand how to debug Python code
Specificaties
Over Anna Ravenscroft
Over Steve Holden
Inhoudsopgave
The Python Language
The Python Standard Library and Extension Modules
Python Implementations
CPython
PyPy
Choosing Between CPython, PyPy, And Other Implementations
Other Developments, Implementations, and Distributions
Licensing and Price Issues
Python Development and Versions
Python Resources
Documentation
Community
Installation
Installing Python from Binaries
macOS
Installing Python from Source Code
Microsoft Windows
Unix-Like Platforms
Installing PyPy
2. The Python Interpreter
The Python Program
Environment Variables
Command-Line Syntax and Options
Interactive Sessions
Python Development Environments
IDLE
Other Python IDEs
Free Text Editors with Python Support
Tools for Checking Python Programs
Running Python Programs
The PyPy Interpreter
3. The Python Language
Lexical Structure
Lines and Indentation
Character Sets
Tokens
Statements
Data Types
Numbers
Sequences
Sets
Dictionaries
None
Ellipsis (...)
Callables
Boolean Values
Variables and Other References
Variables
Assignment Statements
del Statements
Expressions and Operators
Comparison Chaining
Short-Circuiting Operators
The ternary operator
Numeric Operations
Numeric Conversions
Arithmetic Operations
Sequence Operations
Strings
Tuples
Lists
Set Operations
Set Membership
Set Methods
Dictionary Operations
Dictionary Membership
Dictionary Methods
Control Flow Statements
The if Statement
||3.10+|| The match statement
The while Statement
The for Statement
The break Statement
The continue Statement
The else Clause on Loop Statements
The pass Statement
The try and raise Statements
The with Statement
Functions
Defining Functions: the def Statement
Parameters
Mutable default parameter values
Argument collector parameters
Attributes of Function Objects
Function Annotations
The return Statement
Calling Functions
Namespaces
lambda expressions
Generators
Recursion
4. Object-Oriented Python
Classes and Instances
Python Classes
The class Statement
The Class Body
Descriptors
Instances
Attribute Reference Basics
Bound and Unbound Methods
Inheritance
The Built-in object Type
Class-Level Methods
Properties
__slots__
__getattribute__
Per-Instance Methods
Inheritance from Built-in Types
Special Methods
General-Purpose Special Methods
Special Methods for Containers
Abstract Base Classes
Special Methods for Numeric Objects
Decorators
Metaclasses
Alternatives to Custom Metaclasses for Simple Class Customization
How Python Determines a Class’s Metaclass
How a Metaclass Creates a Class
Data Classes
Enumerated types (Enums)
5. Exceptions
The try Statement
try/except
try/finally
The try/except/finally Statement
The with Statement and Context Managers
Generators and Exceptions
Exception Propagation
The raise Statement
Exception Objects
The Hierarchy of Standard Exceptions
Standard Exception Classes
Custom Exception Classes
Custom Exceptions and Multiple Inheritance
Other Exceptions Used in the Standard Library
Error-Checking Strategies
LBYL Versus EAFP
Handling Errors in Large Programs
Logging Errors
The assert Statement
The __debug__ Built-in Variable
6. Modules
Module Objects
The import Statement
The from Statement
Module Loading
Built-in Modules
Searching the Filesystem for a Module
The Main Program
Reloading Modules
Circular Imports
sys.modules Entries
Custom Importers
Packages
Special Attributes of Package Objects
Namespace Packages
Absolute Versus Relative Imports
Distribution Utilities (distutils) and setuptools
Python Wheels
Python Environments
Enter the Virtual Environment
What Is a Virtual Environment?
Creating and Deleting Virtual Environments
Working with Virtual Environments
Managing Dependency Requirements
Other environment management solutions
Best practices with virtualenvs
7. Core Built-ins and Standard Library Modules
Built-in Types
Built-in Functions
Dynamic Execution
Avoiding exec
Expressions
Compile and Code Objects
Never exec or eval Untrusted Code
The sys Module
The copy Module
The collections Module
ChainMap
Counter
OrderedDict
defaultdict
keydefaultdict
deque
The functools Module
The heapq Module
The Decorate-Sort-Undecorate Idiom
The argparse Module
The itertools Module
8. Strings and Things
Methods of String, Bytes and Bytearray Objects
The string Module
String Formatting
Values by expression evaluation
Values by argument lookup
Value Conversion
Value Formatting
Formatted String Literals
Legacy String Formatting with %
Format Specifier Syntax
Text Wrapping and Filling
The pprint Module
The reprlib Module
Unicode
The codecs Module
The unicodedata Module
9. Regular Expressions
Regular Expressions and the re Module
REs and bytes Versus str
Pattern-String Syntax
Common Regular Expression Idioms
Sets of Characters
Alternatives
Groups
Optional Flags
Match Versus Search
Anchoring at String Start and End
Regular Expression Objects
Match Objects
Functions of the re Module
REs and the := operator
The 3rd party regex module
10. Persistence and Databases
Serialization
The csv Module
The json Module
The pickle Module
The shelve Module
DBM Modules
The dbm Package
Examples of DBM-Like File Use
Berkeley DB Interfacing
The Python Database API (DBAPI) 2.0
Exception Classes
Thread Safety
Parameter Style
Factory Functions
Type Description Attributes
The connect Function
Connection Objects
Cursor Objects
DBAPI-Compliant Modules
SQLite
class sqlite3.Connection
class sqlite3.Row
11. Time Operations
The time Module
The datetime Module
The date Class
The time Class
The datetime Class
The timedelta Class
The dateutil Module
The sched Module
The calendar Module
12. Controlling Execution
Per-Site Customization
The site and sitecustomize Modules
Termination Functions
Dynamic Execution and exec
Avoiding exec
Expressions
Compile and Code Objects
Never exec or eval Untrusted Code
Internal Types
Type Objects
The Code Object Type
The frame Type
Garbage Collection
The gc Module
The weakref Module
13. Numeric Processing
Floating-point Values
The math and cmath Modules
The operator Module
Random and Pseudorandom Numbers
The random Module
Physically and Cryptographically Strong Random Numbers:the secrets module
The fractions Module
The decimal Module
Array Processing
The array Module
Extensions for Numeric Array Computation
NumPy
Creating a NumPy Array
Shape, Indexing, and Slicing
Matrix Operations in NumPy
SciPy
Additional Numeric Packages
14. Testing, Debugging, and Optimizing
Testing
Unit Testing and System Testing
The doctest Module
The unittest Module
Testing with pytest
Debugging
Before You Debug
The inspect Module
The traceback Module
The pdb Module
The warnings Module
Classes
Objects
Filters
Functions
Optimization
Developing a Fast-Enough Python Application
Benchmarking
Large-Scale Optimization
Profiling
Small-Scale Optimization
15. Networking Basics
The Berkeley Socket Interface
Socket Addresses
Client-Server Computing
The socket Module
Socket Objects
A Connectionless Socket Client
A Connectionless Socket Server
A Connection-Oriented Socket Client
A Connection-Oriented Socket Server
Transport Layer Security (TLS, AKA SSL)
SSLContext
16. Client-Side Network Protocol Modules
Email Protocols
The poplib Module
The smtplib Module
HTTP and URL Clients
URL Access
The Third-Party requests Package
The urllib Package
Other Network Protocols
17. Serving HTTP
http.server
WSGI
WSGI Servers
ASGI
Python Web Frameworks
“Full-Stack” Versus “Lightweight” Frameworks
A Few Popular Full-Stack Frameworks
Some Popular Lightweight Frameworks
Summary
18. Email, MIME, and Other Network Encodings
MIME and Email Format Handling
Functions in the email Package
The email.message Module
The email.Generator Module
Creating Messages
The email.encoders Module
The email.utils Module
Example Uses of the email Package
Encoding Binary Data as ASCII Text
The base64 Module
The quopri Module
The uu Module
19. Structured Text: HTML
The html.entities Module
The BeautifulSoup Third-Party Package
The BeautifulSoup Class
The Navigable Classes of bs4
bs4 find... Methods (“Search Methods”)
bs4 CSS Selectors
An HTML Parsing Example with BeautifulSoup
Generating HTML
Editing and Creating HTML with bs4
Building HTML with bs4
Templating
The jinja2 Package
The jinja2.Environment Class
The jinja2.Template Class
20. Structured Text: XML
ElementTree
The Element Class
The ElementTree Class
Functions in the ElementTree Module
Parsing XML with ElementTree.parse
Building an ElementTree from Scratch
Parsing XML Iteratively
About the Authors
Anderen die dit boek kochten, kochten ook
Net verschenen
Rubrieken
- aanbestedingsrecht
- aansprakelijkheids- en verzekeringsrecht
- accountancy
- algemeen juridisch
- arbeidsrecht
- bank- en effectenrecht
- bestuursrecht
- bouwrecht
- burgerlijk recht en procesrecht
- europees-internationaal recht
- fiscaal recht
- gezondheidsrecht
- insolventierecht
- intellectuele eigendom en ict-recht
- management
- mens en maatschappij
- milieu- en omgevingsrecht
- notarieel recht
- ondernemingsrecht
- pensioenrecht
- personen- en familierecht
- sociale zekerheidsrecht
- staatsrecht
- strafrecht en criminologie
- vastgoed- en huurrecht
- vreemdelingenrecht