--- /dev/null
+# Stubs for string\r
+\r
+# Based on http://docs.python.org/3.2/library/string.html\r
+\r
+from typing import Mapping, Sequence, Any, Optional, Union, List, Tuple, Iterable, AnyStr\r
+\r
+ascii_letters = ... # type: str\r
+ascii_lowercase = ... # type: str\r
+ascii_uppercase = ... # type: str\r
+digits = ... # type: str\r
+hexdigits = ... # type: str\r
+letters = ... # type: str\r
+lowercase = ... # type: str\r
+octdigits = ... # type: str\r
+punctuation = ... # type: str\r
+printable = ... # type: str\r
+uppercase = ... # type: str\r
+whitespace = ... # type: str\r
+\r
+def capwords(s: AnyStr, sep: AnyStr = ...) -> AnyStr: ...\r
+# TODO: originally named 'from'\r
+def maketrans(_from: str, to: str) -> str: ...\r
+def atof(s: unicode) -> float: ...\r
+def atoi(s: unicode, base: int = ...) -> int: ...\r
+def atol(s: unicode, base: int = ...) -> int: ...\r
+def capitalize(word: AnyStr) -> AnyStr: ...\r
+def find(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...\r
+def rfind(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...\r
+def index(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...\r
+def rindex(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...\r
+def count(s: unicode, sub: unicode, start: int = ..., end: int = ...) -> int: ...\r
+def lower(s: AnyStr) -> AnyStr: ...\r
+def split(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...\r
+def rsplit(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...\r
+def splitfields(s: AnyStr, sep: AnyStr = ..., maxsplit: int = ...) -> List[AnyStr]: ...\r
+def join(words: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ...\r
+def joinfields(word: Iterable[AnyStr], sep: AnyStr = ...) -> AnyStr: ...\r
+def lstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ...\r
+def rstrip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ...\r
+def strip(s: AnyStr, chars: AnyStr = ...) -> AnyStr: ...\r
+def swapcase(s: AnyStr) -> AnyStr: ...\r
+def translate(s: str, table: str, deletechars: str = ...) -> str: ...\r
+def upper(s: AnyStr) -> AnyStr: ...\r
+def ljust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ...\r
+def rjust(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ...\r
+def center(s: AnyStr, width: int, fillchar: AnyStr = ...) -> AnyStr: ...\r
+def zfill(s: AnyStr, width: int) -> AnyStr: ...\r
+def replace(s: AnyStr, old: AnyStr, new: AnyStr, maxreplace: int = ...) -> AnyStr: ...\r
+\r
+class Template(object):\r
+ # TODO: Unicode support?\r
+ template = ... # type: str\r
+\r
+ def __init__(self, template: str) -> None: ...\r
+ def substitute(self, mapping: Mapping[str, str] = ..., **kwds: str) -> str: ...\r
+ def safe_substitute(self, mapping: Mapping[str, str] = ...,\r
+ **kwds: str) -> str: ...\r
+\r
+# TODO(MichalPokorny): This is probably badly and/or loosely typed.\r
+class Formatter(object):\r
+ def format(self, format_string: str, *args, **kwargs) -> str: ...\r
+ def vformat(self, format_string: str, args: Sequence[Any],\r
+ kwargs: Mapping[str, Any]) -> str: ...\r
+ def parse(self, format_string: str) -> Iterable[Tuple[str, str, str, str]]: ...\r
+ def get_field(self, field_name: str, args: Sequence[Any],\r
+ kwargs: Mapping[str, Any]) -> Any: ...\r
+ def get_value(self, key: Union[int, str], args: Sequence[Any],\r
+ kwargs: Mapping[str, Any]) -> Any:\r
+ raise IndexError()\r
+ raise KeyError()\r
+ def check_unused_args(self, used_args: Sequence[Union[int, str]], args: Sequence[Any],\r
+ kwargs: Mapping[str, Any]) -> None: ...\r
+ def format_field(self, value: Any, format_spec: str) -> Any: ...\r
+ def convert_field(self, value: Any, conversion: str) -> Any: ...\r