Author: | John T. Wodder II (@jwodder) |
---|---|
Date: | 2020-07-28 |
Updates: | Updated version posted at <https://jwodder.github.io/kbits/posts/rst-hyperlinks/> |
Copyright: | Copyright © 2020 John T. Wodder II. This work is licensed under a `Creative Commons Attribution 4.0 International License`_. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 / ":" / "@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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... |