Appendix B. Reference Tables

Python Keywords

Table B.1 lists Python’s keywords.

Table B.1. Python Keywordsa

image

Python Standard Operators and Functions

Table B.2 represents the operators and (built-in and factory) functions that can be used with most standard Python objects as well as user-defined objects in which you have implemented their corresponding special methods.

Table B.2. Standard Type Operators and Functions

image

image

Numeric Type Operators and Functions

Table B.3 represents the operators and (built-in and factory) functions that apply to Python’s numeric objects.

Table B.3. Operators and Built-in Functions for All Numeric Types

image

image

image

Sequence Type Operators and Functions

Table B.4 contains the set of operators, (built-in and factory) functions, and built-in methods that can be used with sequence types.

Table B.4. Sequence Type Operators, Built-in Functions, and Methods

image

image

image

String Format Operator Conversion Symbols

Table B.5 lists the formatting symbols that can be used with the string format operator ( % ).

Table B.5. String Format Operator Conversion Symbols

image

String Format Operator Directives

When using the string format operator (see Table B.5), you may enhance or fine-tune the object display with the directives shown in Table B.6.

Table B.6. Format Operator Auxiliary Directives

image

String Type Built-in Methods

The descriptions for the string built-in methods listed above are given in Table B.7.

Table B.7. String Type Built-in Methods

image

image

image

image

List Type Built-in Methods

In Table B.8, we present full descriptions and usage syntax for the list built-in methods given above.

Table B.8. List Type Built-in Methods

image

Dictionary Type Built-in Methods

In Table B.9, we list the full description and usage syntax for the dictionary built-in methods listed below.

Table B.9. Dictionary Type Methods

image

Set Types Operators and Functions

Table B.10 outlines the various operators, (built-in and factory) functions, and built-in methods that apply to both set types (set [mutable] and frozenset [immutable]).

Table B.10. Set Type Operators, Functions, and Methods

image

image

File Object Methods and Data Attributes

Table B.11 lists the built-in methods and data attributes of file objects.

Table B.11. Methods for File Objects

image

image

Python Exceptions

Table B.12 lists exceptions in Python.

Table B.12. Python Built-In Exceptions

image

image

image

Special Methods for Classes

Table B.13 represents the set of special methods that can be implemented to allow user-defined objects to take on behaviors and functionality of Python standard types.

Table B.13. Special Methods for Customizing Classes

image

image

image

image

Python Operator Summary

Table B.14 represents the complete set of Python operators and to which standard types they apply. The operators are sorted from highest-to-lowest precedence, with those sharing the same shaded group having the same priority.

Table B.14. Python Operators († - unary)

image

image

image

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset