Mypy 1.8.0 Documentationfundamental aspect of the PEP 484 type system: when we annotate some variable with a type T, we are actually telling mypy that variable can be assigned an instance of T, or an instance of a subtype of T you have a class Child that inherits from Parent, then a value of type Child can be assigned to a variable of type Parent. For example, a RuntimeError instance can be passed to a function that is annotated normalize_id function above – mypy understands basic isinstance checks and so can infer that the user_id variable was of type int in the if-branch and of type str in the else-branch. As another example, consider0 码力 | 234 页 | 902.89 KB | 1 年前3
Mypy 1.8.0 Documentationcollections Redefinitions with incompatible types Invariance vs covariance Declaring a supertype as variable type Complex type tests Python version and system platform checks Displaying the type of an expression attribute exists in each union item [union-attr] Check that name is defined [name-defined] Check that a variable is not used before it’s defined [used-before-def] Check arguments in calls [call-arg] Check argument overloaded functions [call-overload] Check validity of types [valid-type] Require annotation if variable type is unclear [var-annotated] Check validity of overrides [override] Check that function returns0 码力 | 318 页 | 271.55 KB | 1 年前3
Mypy 1.10.0+dev Documentationcollections Redefinitions with incompatible types Invariance vs covariance Declaring a supertype as variable type Complex type tests Python version and system platform checks Displaying the type of an expression attribute exists in each union item [union-attr] Check that name is defined [name-defined] Check that a variable is not used before it’s defined [used-before-def] Check arguments in calls [call-arg] Check argument overloaded functions [call-overload] Check validity of types [valid-type] Require annotation if variable type is unclear [var-annotated] Check validity of overrides [override] Check that function returns0 码力 | 318 页 | 270.84 KB | 1 年前3
Jinja2 Documentation Release 2.10string marking the end of a block. Defaults to '%}'. variable_start_string The string marking the beginning of a print statement. Defaults to '{{'. variable_end_string The string marking the end of a print 2. trim_blocks If this is set to True the first newline after a block is re- moved (block, not variable tag!). Defaults to False. lstrip_blocks If this is set to True leading spaces and tabs are stripped unde- fined values in the template. finalize A callable that can be used to process the result of a variable expression before it is output. For example one can convert None implicitly into an empty string0 码力 | 148 页 | 475.08 KB | 1 年前3
Mypy 1.10.0+dev Documentationfundamental aspect of the PEP 484 type system: when we annotate some variable with a type T, we are actually telling mypy that variable can be assigned an instance of T, or an instance of a subtype of T you have a class Child that inherits from Parent, then a value of type Child can be assigned to a variable of type Parent. For example, a RuntimeError instance can be passed to a function that is annotated normalize_id function above – mypy understands basic isinstance checks and so can infer that the user_id variable was of type int in the if-branch and of type str in the else-branch. As another example, consider0 码力 | 234 页 | 913.89 KB | 1 年前3
PyMuPDF 1.12.2 documentationwhere on a page a certain string appears: >>> areas = page.searchFor("mupdf", hit_max = 16) The variable areas will contain a list of up to 16 Rectangles, each of which surrounds one occurrence of the enumerations of MuPDF as implemented by PyMuPDF. Each of the following variables is accessible as fitz.variable. Constants Base14_Fonts Predefined Python list of valid PDF Base 14 Fonts. Return type: list of horizontal whitespace (including horizontal tabs) will be replaced with space characters of variable width. TEXT_PRESERVE_IMAGES 4 - If this option is set, then images will be stored in the structured0 码力 | 387 页 | 2.70 MB | 1 年前3
Celery 1.0 Documentationimported. You can set a custom name for the configuration module with the CELERY_CONFIG_MODULE variable. In these examples we use the default name. Let’s create our celeryconfig.py. 1. Configure how 4. Now remembers the previously detected loader by keeping it in the CELERY_LOADER environment variable. This may help on windows where fork emulation is used. ETA no longer sends datetime objects, __getitem__``+``pop raises NotRegistered instead You can set the loader via the CELERY_LOADER environment variable. You can now set CELERY_IGNORE_RESULT to ignore task results by default (if enabled, tasks doesn’t0 码力 | 221 页 | 283.64 KB | 1 年前3
The Python Handbook
3. Running Python programs 4. Python 2 vs Python 3 5. The basics of working with Python 5.1. Variable 5.2. Expressions and statement 5.3. Comment 5.4. Indentation 6. Data Types 7. Operators 7 type any Python code here, and press the enter key to run it. For example try defining a new variable using name = "Flavio" and then print its value, using print() : print(name) 10 Note: in the This book focuses on Python 3. 5. The basics of working with Python 5.1. Variable We can create a new Python variable by assigning a value to a label, using the = assignment operator. In this0 码力 | 93 页 | 7.31 MB | 1 年前3
Flask Documentation (1.1.x)exporting the FLASK_APP environment variable: $ export FLASK_APP=hello.py $ flask run * Running on http://127.0.0.1:5000/ If you are on Windows, the environment variable syntax depends on command line interpreter see the alternative method for running a server. Invalid Import Name The FLASK_APP environment variable is the name of the module to import at flask run. In case that module is incorrectly named you will enable all development features (including debug mode) you can export the FLASK_ENV environment variable and set it to development before running the server: $ export FLASK_ENV=development $ flask run0 码力 | 428 页 | 895.98 KB | 1 年前3
Flask Documentation (1.1.x)exporting the FLASK_APP environment variable: $ export FLASK_APP=hello.py $ flask run * Running on http://127.0.0.1:5000/ If you are on Windows, the environment variable syntax depends on command line interpreter see the alternative method for running a server. Invalid Import Name The FLASK_APP environment variable is the name of the module to import at flask run. In case that module is incorrectly named you will enable all development features (including debug mode) you can export the FLASK_ENV environment variable and set it to development before running the server: 8 Chapter 1. User’s Guide Flask Documentation0 码力 | 291 页 | 1.25 MB | 1 年前3
共 400 条
- 1
- 2
- 3
- 4
- 5
- 6
- 40













