From 0604c41123b9266c0ed0ab67b3782aece57b3bb6 Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Sat, 20 Jun 2020 16:51:01 +0200 Subject: [PATCH] More Monkeytyping --- Pipfile | 11 +++++++++++ dpaste/types.py | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 Pipfile create mode 100644 dpaste/types.py diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..9534830 --- /dev/null +++ b/Pipfile @@ -0,0 +1,11 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] + +[packages] + +[requires] +python_version = "3.6" diff --git a/dpaste/types.py b/dpaste/types.py new file mode 100644 index 0000000..7000510 --- /dev/null +++ b/dpaste/types.py @@ -0,0 +1,7 @@ +from typing import Tuple, Union + +# A pypi version ala (1, 1), (1, 1, 0) or (1, 1, 'a1'). +VersionType = Union[Tuple[int, int], Tuple[int, int, Union[int, str]]] + +# Django choices where they key can either be a string or integer. +DjangoChoicesType = Tuple[Tuple[Union[int, str], str], ...]