From b9616f1517e0200931ea314200f8a7fd437ef412 Mon Sep 17 00:00:00 2001 From: David Euresti Date: Wed, 5 Apr 2017 16:51:26 -0400 Subject: [PATCH] Merge base64 module into 2and3 (#1141) * Merge base64 module * Move base64 into 2and3 --- stdlib/2/base64.pyi | 25 ------------------------- stdlib/{3 => 2and3}/base64.pyi | 8 +++++--- 2 files changed, 5 insertions(+), 28 deletions(-) delete mode 100644 stdlib/2/base64.pyi rename stdlib/{3 => 2and3}/base64.pyi (90%) diff --git a/stdlib/2/base64.pyi b/stdlib/2/base64.pyi deleted file mode 100644 index d593fa8c8..000000000 --- a/stdlib/2/base64.pyi +++ /dev/null @@ -1,25 +0,0 @@ -# Stubs for base64 - -# Based on http://docs.python.org/3.2/library/base64.html - -from typing import IO - -def b64encode(s: str, altchars: str = ...) -> str: ... -def b64decode(s: str, altchars: str = ..., - validate: bool = ...) -> str: ... -def standard_b64encode(s: str) -> str: ... -def standard_b64decode(s: str) -> str: ... -def urlsafe_b64encode(s: str) -> str: ... -def urlsafe_b64decode(s: str) -> str: ... -def b32encode(s: str) -> str: ... -def b32decode(s: str, casefold: bool = ..., - map01: str = ...) -> str: ... -def b16encode(s: str) -> str: ... -def b16decode(s: str, casefold: bool = ...) -> str: ... - -def decode(input: IO[str], output: IO[str]) -> None: ... -def decodebytes(s: str) -> str: ... -def decodestring(s: str) -> str: ... -def encode(input: IO[str], output: IO[str]) -> None: ... -def encodebytes(s: str) -> str: ... -def encodestring(s: str) -> str: ... diff --git a/stdlib/3/base64.pyi b/stdlib/2and3/base64.pyi similarity index 90% rename from stdlib/3/base64.pyi rename to stdlib/2and3/base64.pyi index 5732c524b..70db6ad80 100644 --- a/stdlib/3/base64.pyi +++ b/stdlib/2and3/base64.pyi @@ -1,10 +1,12 @@ # Stubs for base64 -from typing import IO, Union +from typing import IO, Union, Text import sys - -if sys.version_info < (3, 3): +if sys.version_info < (3,): + _encodable = Union[bytes, Text] + _decodable = Union[bytes, Text] +elif sys.version_info < (3, 3): _encodable = bytes _decodable = bytes elif sys.version_info[:2] == (3, 3):