From 746f4db9899dfccb2e236033f6736e1665e1286d Mon Sep 17 00:00:00 2001 From: Alvaro Caceres Date: Mon, 25 Jul 2016 15:03:42 -0500 Subject: [PATCH] Change constants to type-equivalent versions (#392) * Change constants to type-equivalent versions For pytype support. " = object()" -> " = ..." Non-zero ints -> 0 * Drop changes to typing and __builtin__ --- stdlib/2.7/os/__init__.pyi | 9 ++------- stdlib/2.7/unittest.pyi | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/stdlib/2.7/os/__init__.pyi b/stdlib/2.7/os/__init__.pyi index cf548b237..4d8e01407 100644 --- a/stdlib/2.7/os/__init__.pyi +++ b/stdlib/2.7/os/__init__.pyi @@ -83,8 +83,8 @@ def isatty(fd: int) -> bool: ... def lseek(fd: int, pos: int, how: int) -> None: ... SEEK_SET = 0 -SEEK_CUR = 1 -SEEK_END = 2 +SEEK_CUR = 0 +SEEK_END = 0 # TODO(prvak): maybe file should be unicode? (same with all other paths...) def open(file: unicode, flags: int, mode: int = ...) -> int: ... @@ -257,11 +257,6 @@ O_DIRECTORY = 0 # Gnu extension if in C library O_NOFOLLOW = 0 # Gnu extension if in C library O_NOATIME = 0 # Gnu extension if in C library -F_OK = 0 -R_OK = 0 -W_OK = 0 -X_OK = 0 - P_NOWAIT = 0 P_NOWAITO = 0 P_WAIT = 0 diff --git a/stdlib/2.7/unittest.pyi b/stdlib/2.7/unittest.pyi index a914cec7a..9c9ba905f 100644 --- a/stdlib/2.7/unittest.pyi +++ b/stdlib/2.7/unittest.pyi @@ -27,7 +27,7 @@ class TestResult: errors = ... # type: List[Tuple[Testable, str]] failures = ... # type: List[Tuple[Testable, str]] testsRun = 0 - shouldStop = False + shouldStop = ... # type: bool def wasSuccessful(self) -> bool: ... def stop(self) -> None: ...