Check the copyright laws and the term of service before using it. You might be breaking the law!
- Open the Network tab of the Chrome Inspector
| # ruff: noqa: ERA001, RUF012, ANN001, ANN206 | |
| """A proof of concept for a simple, ~50 LOC (excluding docstrings/comments) | |
| lazy-imports-enabling context manager to be added to and used within the standard library. | |
| This would fulfill common use cases both inside and outside the Python standard library | |
| e.g. inline imports and if TYPE_CHECKING blocks for typing/annotation-related imports. | |
| However, it can't currently work without fixing a few things upstream. | |
| Problems with LazyLoader |
| import __future__ | |
| # import _bootlocale # Doesn't exist on 3.11 on Windows | |
| import _collections_abc | |
| import _compat_pickle | |
| import _compression | |
| # import _dummy_thread # Doesn't exist in 3.9+ in WSL | |
| import _markupbase | |
| import _osx_support |
| # unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" | |
| UNRESERVED_PAT: str = r"([A-Za-z0-9\-\._~])" | |
| # pct-encoded = "%" HEXDIG HEXDIG | |
| PCT_ENCODED_PAT: str = r"(%[A-F0-9][A-F0-9])" | |
| # sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" | |
| SUB_DELIMS_PAT: str = r"([!\$&'\(\)\*\+,;=])" | |
| # pchar = unreserved / pct-encoded / sub-delims / ":" / "@" |
| import ast | |
| import os | |
| import sys | |
| from io import BytesIO | |
| from typing import TYPE_CHECKING, Tuple, Union | |
| if sys.version_info >= (3, 10) or TYPE_CHECKING: | |
| StrPath = Union[str, os.PathLike[str]] | |
| else: | |
| StrPath = Union[str, os.PathLike] |
| # pyright: enableExperimentalFeatures=true | |
| # PEP 712 is only active for pyright with the "enableExperimentalFeatures" setting enabled. | |
| import operator | |
| import re | |
| import sys | |
| from typing import ( | |
| TYPE_CHECKING, | |
| Callable, | |
| ClassVar, |
| CREATE TABLE accounts( | |
| id serial PRIMARY KEY, | |
| name VARCHAR(256) NOT NULL | |
| ); | |
| CREATE TABLE entries( | |
| id serial PRIMARY KEY, | |
| description VARCHAR(1024) NOT NULL, | |
| amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0), | |
| -- Every entry is a credit to one account... |