From 4f14617db1910e953bf1cab290f0d8381a5cf340 Mon Sep 17 00:00:00 2001 From: Ashwini Chaudhary Date: Sat, 12 Aug 2017 05:39:57 +0530 Subject: [PATCH] Add stub for codeop to 2and3 (#1534) --- stdlib/2and3/codeop.pyi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 stdlib/2and3/codeop.pyi diff --git a/stdlib/2and3/codeop.pyi b/stdlib/2and3/codeop.pyi new file mode 100644 index 000000000..826e40882 --- /dev/null +++ b/stdlib/2and3/codeop.pyi @@ -0,0 +1,17 @@ +# Source(py2): https://hg.python.org/cpython/file/2.7/Lib/codeop.py +# Source(py3): https://github.com/python/cpython/blob/master/Lib/codeop.py + +from types import CodeType +from typing import Optional + +def compile_command(source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ... + +class Compile: + flags = ... # type: int + def __init__(self) -> None: ... + def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ... + +class CommandCompiler: + compiler = ... # type: Compile + def __init__(self) -> None: ... + def __call__(self, source: str, filename: str = ..., symbol: str = ...) -> Optional[CodeType]: ...