From 2b7ffe086bbc986474ced24a5b5347103208b663 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 7 Jun 2019 23:59:17 -0700 Subject: [PATCH] Add missing constructor to types.CodeType. I got the argument order from https://github.com/python/cpython/blob/2bfc2dc214445550521074f428245b502d215eac/Objects/codeobject.c#L263 and the types from the attributes already in the stub. --- stdlib/2/types.pyi | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/stdlib/2/types.pyi b/stdlib/2/types.pyi index 5984706aee8a..93360e7dec35 100644 --- a/stdlib/2/types.pyi +++ b/stdlib/2/types.pyi @@ -64,6 +64,23 @@ class CodeType: co_nlocals: int co_stacksize: int co_varnames: Tuple[str, ...] + def __init__( + self, + argcount: int, + nlocals: int, + stacksize: int, + flags: int, + codestring: str, + constants: Tuple[Any, ...], + names: Tuple[str, ...], + varnames: Tuple[str, ...], + filename: str, + name: str, + firstlineno: int, + lnotab: str, + freevars: Tuple[str, ...] = ..., + cellvars: Tuple[str, ...] = ..., + ) -> None: ... class GeneratorType: gi_code: CodeType