 Jinja2 Documentation Release 2.10Introduction 3 2 API 7 3 Sandbox 39 4 Native Python Types 45 5 Template Designer Documentation 47 6 Extensions 89 7 Integration 107 8 Switching from other Template Engines 109 9 Tips and Tricks 115 II Additional install the package via distribute in development mode. This also has the advantage that the C extensions are compiled. 1.2.4 MarkupSafe Dependency As of version 2.7 Jinja2 depends on the MarkupSafe documentation is written with Python 2 in mind, so you will have to adapt the shown code examples to Python 3 syntax for yourself. 5 6 CHAPTER 2 API This document describes the API to Jinja2 and not the template0 码力 | 148 页 | 475.08 KB | 1 年前3 Jinja2 Documentation Release 2.10Introduction 3 2 API 7 3 Sandbox 39 4 Native Python Types 45 5 Template Designer Documentation 47 6 Extensions 89 7 Integration 107 8 Switching from other Template Engines 109 9 Tips and Tricks 115 II Additional install the package via distribute in development mode. This also has the advantage that the C extensions are compiled. 1.2.4 MarkupSafe Dependency As of version 2.7 Jinja2 depends on the MarkupSafe documentation is written with Python 2 in mind, so you will have to adapt the shown code examples to Python 3 syntax for yourself. 5 6 CHAPTER 2 API This document describes the API to Jinja2 and not the template0 码力 | 148 页 | 475.08 KB | 1 年前3
 Mypy 1.10.0+dev Documentationnot at runtime Using types defined in stubs but not at runtime Using generic builtins Using X | Y syntax for Unions Using new additions to the typing module Protocols and structural subtyping Predefined Type Guards Limitations Duck type compatibility Stub files Creating a stub Stub file syntax Using stub file syntax at runtime Generics Defining generic classes Defining subclasses of generic classes Literal types and Enums Literal types Enums TypedDict Totality Supported operations Class-based syntax Mixing required and non-required items Unions of TypedDicts Final names, methods and classes Final0 码力 | 318 页 | 270.84 KB | 1 年前3 Mypy 1.10.0+dev Documentationnot at runtime Using types defined in stubs but not at runtime Using generic builtins Using X | Y syntax for Unions Using new additions to the typing module Protocols and structural subtyping Predefined Type Guards Limitations Duck type compatibility Stub files Creating a stub Stub file syntax Using stub file syntax at runtime Generics Defining generic classes Defining subclasses of generic classes Literal types and Enums Literal types Enums TypedDict Totality Supported operations Class-based syntax Mixing required and non-required items Unions of TypedDicts Final names, methods and classes Final0 码力 | 318 页 | 270.84 KB | 1 年前3
 Mypy 1.8.0 Documentationnot at runtime Using types defined in stubs but not at runtime Using generic builtins Using X | Y syntax for Unions Using new additions to the typing module Protocols and structural subtyping Predefined Type Guards Limitations Duck type compatibility Stub files Creating a stub Stub file syntax Using stub file syntax at runtime Generics Defining generic classes Defining subclasses of generic classes Literal types and Enums Literal types Enums TypedDict Totality Supported operations Class-based syntax Mixing required and non-required items Unions of TypedDicts Final names, methods and classes Final0 码力 | 318 页 | 271.55 KB | 1 年前3 Mypy 1.8.0 Documentationnot at runtime Using types defined in stubs but not at runtime Using generic builtins Using X | Y syntax for Unions Using new additions to the typing module Protocols and structural subtyping Predefined Type Guards Limitations Duck type compatibility Stub files Creating a stub Stub file syntax Using stub file syntax at runtime Generics Defining generic classes Defining subclasses of generic classes Literal types and Enums Literal types Enums TypedDict Totality Supported operations Class-based syntax Mixing required and non-required items Unions of TypedDicts Final names, methods and classes Final0 码力 | 318 页 | 271.55 KB | 1 年前3
 Mypy 1.8.0 Documentationvarying-length sequences. You can use the type tuple[T, ...] (with a literal ... – it’s part of the syntax) for this purpose. Example: def print_squared(t: tuple[int, ...]) -> None: for n in t: print(n X | Y syntax for Unions PEP 604 introduced an alternative way for spelling union types. In Python 3.10 and later, you can write Union[int, str] as int | str. It is possible to use this syntax in versions Kinds of types 31 Mypy Documentation, Release 1.8.0 from typing import TypeAlias # "from typing_extensions" in Python 3.9 and earlier AliasType: TypeAlias = Union[list[dict[tuple[int, str], set[int]]]0 码力 | 234 页 | 902.89 KB | 1 年前3 Mypy 1.8.0 Documentationvarying-length sequences. You can use the type tuple[T, ...] (with a literal ... – it’s part of the syntax) for this purpose. Example: def print_squared(t: tuple[int, ...]) -> None: for n in t: print(n X | Y syntax for Unions PEP 604 introduced an alternative way for spelling union types. In Python 3.10 and later, you can write Union[int, str] as int | str. It is possible to use this syntax in versions Kinds of types 31 Mypy Documentation, Release 1.8.0 from typing import TypeAlias # "from typing_extensions" in Python 3.9 and earlier AliasType: TypeAlias = Union[list[dict[tuple[int, str], set[int]]]0 码力 | 234 页 | 902.89 KB | 1 年前3
 Scrapy 2.4 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 6.4 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . own functionality using signals and a well-defined API (middlewares, extensions, and pipelines). • Wide range of built-in extensions and middlewares for handling: – cookies and session handling – HTTP page) 2016-12-16 21:24:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/ ˓→min), scraped 0 items (at 0 items/min) 2016-12-16 21:24:05 [scrapy.extensions.telnet] DEBUG: Telnet console listening0 码力 | 354 页 | 1.39 MB | 1 年前3 Scrapy 2.4 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 6.4 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . own functionality using signals and a well-defined API (middlewares, extensions, and pipelines). • Wide range of built-in extensions and middlewares for handling: – cookies and session handling – HTTP page) 2016-12-16 21:24:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/ ˓→min), scraped 0 items (at 0 items/min) 2016-12-16 21:24:05 [scrapy.extensions.telnet] DEBUG: Telnet console listening0 码力 | 354 页 | 1.39 MB | 1 年前3
 Scrapy 2.3 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 6.4 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . own functionality using signals and a well-defined API (middlewares, extensions, and pipelines). • Wide range of built-in extensions and middlewares for handling: – cookies and session handling – HTTP opened 2016-12-16 21:24:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/ ˓→min), scraped 0 items (at 0 items/min) 2016-12-16 21:24:05 [scrapy.extensions.telnet] DEBUG: Telnet console listening0 码力 | 352 页 | 1.36 MB | 1 年前3 Scrapy 2.3 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 6.4 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . own functionality using signals and a well-defined API (middlewares, extensions, and pipelines). • Wide range of built-in extensions and middlewares for handling: – cookies and session handling – HTTP opened 2016-12-16 21:24:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/ ˓→min), scraped 0 items (at 0 items/min) 2016-12-16 21:24:05 [scrapy.extensions.telnet] DEBUG: Telnet console listening0 码力 | 352 页 | 1.36 MB | 1 年前3
 Scrapy 1.4 DocumentationMiddleware Customize the input and output of your spiders. Extensions Extend Scrapy with your custom functionality Core API Use it on extensions and middlewares to extend Scrapy functionality Signals own functionality using signals and a well-defined API (middlewares, extensions, and pipelines). Wide range of built-in extensions and middlewares for handling: cookies and session handling HTTP features opened 2016-12-16 21:24:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min) 2016-12-16 21:24:05 [scrapy.extensions.telnet] DEBUG: Telnet console listening0 码力 | 394 页 | 589.10 KB | 1 年前3 Scrapy 1.4 DocumentationMiddleware Customize the input and output of your spiders. Extensions Extend Scrapy with your custom functionality Core API Use it on extensions and middlewares to extend Scrapy functionality Signals own functionality using signals and a well-defined API (middlewares, extensions, and pipelines). Wide range of built-in extensions and middlewares for handling: cookies and session handling HTTP features opened 2016-12-16 21:24:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min) 2016-12-16 21:24:05 [scrapy.extensions.telnet] DEBUG: Telnet console listening0 码力 | 394 页 | 589.10 KB | 1 年前3
 Mypy 1.10.0+dev Documentationvarying-length sequences. You can use the type tuple[T, ...] (with a literal ... – it’s part of the syntax) for this purpose. Example: def print_squared(t: tuple[int, ...]) -> None: for n in t: print(n X | Y syntax for Unions PEP 604 introduced an alternative way for spelling union types. In Python 3.10 and later, you can write Union[int, str] as int | str. It is possible to use this syntax in versions also improve readability by making the intent clear: from typing import TypeAlias # "from typing_extensions" in Python 3.9 and earlier AliasType: TypeAlias = Union[list[dict[tuple[int, str], set[int]]]0 码力 | 234 页 | 913.89 KB | 1 年前3 Mypy 1.10.0+dev Documentationvarying-length sequences. You can use the type tuple[T, ...] (with a literal ... – it’s part of the syntax) for this purpose. Example: def print_squared(t: tuple[int, ...]) -> None: for n in t: print(n X | Y syntax for Unions PEP 604 introduced an alternative way for spelling union types. In Python 3.10 and later, you can write Union[int, str] as int | str. It is possible to use this syntax in versions also improve readability by making the intent clear: from typing import TypeAlias # "from typing_extensions" in Python 3.9 and earlier AliasType: TypeAlias = Union[list[dict[tuple[int, str], set[int]]]0 码力 | 234 页 | 913.89 KB | 1 年前3
 Scrapy 2.2 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 6.4 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . own functionality using signals and a well-defined API (middlewares, extensions, and pipelines). • Wide range of built-in extensions and middlewares for handling: – cookies and session handling – HTTP opened 2016-12-16 21:24:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/ ˓→min), scraped 0 items (at 0 items/min) 2016-12-16 21:24:05 [scrapy.extensions.telnet] DEBUG: Telnet console listening0 码力 | 348 页 | 1.35 MB | 1 年前3 Scrapy 2.2 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 6.4 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . own functionality using signals and a well-defined API (middlewares, extensions, and pipelines). • Wide range of built-in extensions and middlewares for handling: – cookies and session handling – HTTP opened 2016-12-16 21:24:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/ ˓→min), scraped 0 items (at 0 items/min) 2016-12-16 21:24:05 [scrapy.extensions.telnet] DEBUG: Telnet console listening0 码力 | 348 页 | 1.35 MB | 1 年前3
 Scrapy 2.6 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 6.4 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . own functionality using signals and a well-defined API (middlewares, extensions, and pipelines). • Wide range of built-in extensions and middlewares for handling: – cookies and session handling – HTTP opened 2016-12-16 21:24:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min),␣ ˓→scraped 0 items (at 0 items/min) 2016-12-16 21:24:05 [scrapy.extensions.telnet] DEBUG: Telnet console listening0 码力 | 384 页 | 1.63 MB | 1 年前3 Scrapy 2.6 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 6.4 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . own functionality using signals and a well-defined API (middlewares, extensions, and pipelines). • Wide range of built-in extensions and middlewares for handling: – cookies and session handling – HTTP opened 2016-12-16 21:24:05 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pages/min),␣ ˓→scraped 0 items (at 0 items/min) 2016-12-16 21:24:05 [scrapy.extensions.telnet] DEBUG: Telnet console listening0 码力 | 384 页 | 1.63 MB | 1 年前3
共 465 条
- 1
- 2
- 3
- 4
- 5
- 6
- 47














