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
# Don't name this file html.py! | |
from __future__ import annotations | |
from typing import * | |
from dataclasses import dataclass | |
from html import escape | |
from html.parser import HTMLParser |
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
LIMIT = 5 | |
BOUND = 'object' | |
def prelude(limit: int, bound: str) -> None: | |
print('from typing import Callable, Iterable, Iterator, Tuple, TypeVar, overload') | |
print('Ts = TypeVar(\'Ts\', bound={bound})'.format(bound=bound)) | |
print('R = TypeVar(\'R\')') | |
for i in range(LIMIT): | |
print('T{i} = TypeVar(\'T{i}\', bound={bound})'.format(i=i+1, bound=bound)) |
OlderNewer