From c1b12970f65764f520a091fad920a71306f6c59f Mon Sep 17 00:00:00 2001 From: alvarocaceres Date: Wed, 20 Jul 2016 12:57:32 -0500 Subject: [PATCH] Change empty string literals to ellipsis (#377) For pytype compatibility --- stdlib/2.7/Cookie.pyi | 4 ++-- stdlib/2.7/calendar.pyi | 2 +- stdlib/2.7/email/utils.pyi | 4 ++-- stdlib/2.7/platform.pyi | 20 ++++++++++---------- stdlib/2.7/rfc822.pyi | 4 ++-- tests/pytype_blacklist.txt | 5 ----- 6 files changed, 17 insertions(+), 22 deletions(-) diff --git a/stdlib/2.7/Cookie.pyi b/stdlib/2.7/Cookie.pyi index 2aea075c0..f42cafcf5 100644 --- a/stdlib/2.7/Cookie.pyi +++ b/stdlib/2.7/Cookie.pyi @@ -14,7 +14,7 @@ class Morsel(dict): value = ... # type: Any coded_value = ... # type: Any def set(self, key, val, coded_val, LegalChars=..., idmap=..., translate=...): ... - def output(self, attrs=None, header=''): ... + def output(self, attrs=None, header=...): ... def js_output(self, attrs=None): ... def OutputString(self, attrs=None): ... @@ -23,7 +23,7 @@ class BaseCookie(dict): def value_encode(self, val): ... def __init__(self, input=None): ... def __setitem__(self, key, value): ... - def output(self, attrs=None, header='', sep=''): ... + def output(self, attrs=None, header=..., sep=...): ... def js_output(self, attrs=None): ... def load(self, rawdata): ... diff --git a/stdlib/2.7/calendar.pyi b/stdlib/2.7/calendar.pyi index e5ee51b2a..cb458acb7 100644 --- a/stdlib/2.7/calendar.pyi +++ b/stdlib/2.7/calendar.pyi @@ -51,7 +51,7 @@ class HTMLCalendar(Calendar): def formatmonthname(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... def formatmonth(self, theyear: int, themonth: int, withyear: bool = ...) -> str: ... def formatyear(self, theyear: int, width: int = 3) -> str: ... - def formatyearpage(self, theyear: int, width: int = 3, css: Optional[str] = 'calendar.css', encoding: Optional[str] = ...) -> str: ... + def formatyearpage(self, theyear: int, width: int = 3, css: Optional[str] = ..., encoding: Optional[str] = ...) -> str: ... class TimeEncoding: def __init__(self, locale: LocaleType) -> None: ... diff --git a/stdlib/2.7/email/utils.pyi b/stdlib/2.7/email/utils.pyi index 33e8894bb..48d2aa358 100644 --- a/stdlib/2.7/email/utils.pyi +++ b/stdlib/2.7/email/utils.pyi @@ -1,6 +1,6 @@ # Stubs for email.utils (Python 2) # -# NOTE: This dynamically typed stub was automatically generated by stubgen. +# Derived from stub automatically generated by stubgen. from email._parseaddr import AddressList as _AddressList from email._parseaddr import mktime_tz as mktime_tz @@ -19,4 +19,4 @@ def unquote(str): ... def decode_rfc2231(s): ... def encode_rfc2231(s, charset=None, language=None): ... def decode_params(params): ... -def collapse_rfc2231_value(value, errors='', fallback_charset=''): ... +def collapse_rfc2231_value(value, errors=..., fallback_charset=...): ... diff --git a/stdlib/2.7/platform.pyi b/stdlib/2.7/platform.pyi index 83c61fa9c..a8c66936e 100644 --- a/stdlib/2.7/platform.pyi +++ b/stdlib/2.7/platform.pyi @@ -1,33 +1,33 @@ # Stubs for platform (Python 2) # -# NOTE: This dynamically typed stub was automatically generated by stubgen. +# Based on stub generated by stubgen. from typing import Any __copyright__ = ... # type: Any DEV_NULL = ... # type: Any -def libc_ver(executable=..., lib='', version='', chunksize=2048): ... -def linux_distribution(distname='', version='', id='', supported_dists=..., full_distribution_name=1): ... -def dist(distname='', version='', id='', supported_dists=...): ... +def libc_ver(executable=..., lib=..., version=..., chunksize=2048): ... +def linux_distribution(distname=..., version=..., id=..., supported_dists=..., full_distribution_name=1): ... +def dist(distname=..., version=..., id=..., supported_dists=...): ... class _popen: tmpfile = ... # type: Any pipe = ... # type: Any bufsize = ... # type: Any mode = ... # type: Any - def __init__(self, cmd, mode='', bufsize=None): ... + def __init__(self, cmd, mode=..., bufsize=None): ... def read(self): ... def readlines(self): ... def close(self, remove=..., error=...): ... __del__ = ... # type: Any -def popen(cmd, mode='', bufsize=None): ... -def win32_ver(release='', version='', csd='', ptype=''): ... -def mac_ver(release='', versioninfo=..., machine=''): ... -def java_ver(release='', vendor='', vminfo=..., osinfo=...): ... +def popen(cmd, mode=..., bufsize=None): ... +def win32_ver(release=..., version=..., csd=..., ptype=...): ... +def mac_ver(release=..., versioninfo=..., machine=...): ... +def java_ver(release=..., vendor=..., vminfo=..., osinfo=...): ... def system_alias(system, release, version): ... -def architecture(executable=..., bits='', linkage=''): ... +def architecture(executable=..., bits=..., linkage=...): ... def uname(): ... def system(): ... def node(): ... diff --git a/stdlib/2.7/rfc822.pyi b/stdlib/2.7/rfc822.pyi index 1c2b032fc..636a985ec 100644 --- a/stdlib/2.7/rfc822.pyi +++ b/stdlib/2.7/rfc822.pyi @@ -1,6 +1,6 @@ # Stubs for rfc822 (Python 2) # -# NOTE: This dynamically typed stub was automatically generated by stubgen. +# Based on stub generated by stubgen. from typing import Any @@ -33,7 +33,7 @@ class Message: def __getitem__(self, name): ... def __setitem__(self, name, value): ... def __delitem__(self, name): ... - def setdefault(self, name, default=''): ... + def setdefault(self, name, default=...): ... def has_key(self, name): ... def __contains__(self, name): ... def __iter__(self): ... diff --git a/tests/pytype_blacklist.txt b/tests/pytype_blacklist.txt index e0ca77330..a3e1bc4c8 100644 --- a/tests/pytype_blacklist.txt +++ b/tests/pytype_blacklist.txt @@ -1,20 +1,15 @@ # Pytype blacklist. Files will not be tested with pytype. -2.7/Cookie.pyi 2.7/StringIO.pyi 2.7/__builtin__.pyi 2.7/argparse.pyi 2.7/builtins.pyi -2.7/calendar.pyi 2.7/codecs.pyi -2.7/email/utils.pyi 2.7/functools.pyi 2.7/inspect.pyi 2.7/logging/__init__.pyi 2.7/os/__init__.pyi -2.7/platform.pyi 2.7/resource.pyi -2.7/rfc822.pyi 2.7/simplejson/__init__.pyi 2.7/socket.pyi 2.7/sqlite3/dbapi2.pyi