7373 ('modules' , List [str ]),
7474 ('ignore_errors' , bool ),
7575 ('recursive' , bool ),
76- ('fast_parser' , bool ),
7776 ])
7877
7978
8079def generate_stub_for_module (module : str , output_dir : str , quiet : bool = False ,
8180 add_header : bool = False , sigs : Dict [str , str ] = {},
8281 class_sigs : Dict [str , str ] = {},
8382 pyversion : Tuple [int , int ] = defaults .PYTHON3_VERSION ,
84- fast_parser : bool = False ,
8583 no_import : bool = False ,
8684 search_path : List [str ] = [],
8785 interpreter : str = sys .executable ) -> None :
@@ -109,7 +107,7 @@ def generate_stub_for_module(module: str, output_dir: str, quiet: bool = False,
109107 target = os .path .join (output_dir , target )
110108 generate_stub (module_path , output_dir , module_all ,
111109 target = target , add_header = add_header , module = module ,
112- pyversion = pyversion , fast_parser = fast_parser )
110+ pyversion = pyversion )
113111 if not quiet :
114112 print ('Created %s' % target )
115113
@@ -174,13 +172,12 @@ def load_python_module_info(module: str, interpreter: str) -> Tuple[str, Optiona
174172
175173def generate_stub (path : str , output_dir : str , _all_ : Optional [List [str ]] = None ,
176174 target : str = None , add_header : bool = False , module : str = None ,
177- pyversion : Tuple [int , int ] = defaults .PYTHON3_VERSION ,
178- fast_parser : bool = False ) -> None :
175+ pyversion : Tuple [int , int ] = defaults .PYTHON3_VERSION
176+ ) -> None :
179177 with open (path , 'rb' ) as f :
180178 source = f .read ()
181179 options = MypyOptions ()
182180 options .python_version = pyversion
183- options .fast_parser = fast_parser
184181 try :
185182 ast = mypy .parse .parse (source , fnam = path , errors = None , options = options )
186183 except mypy .errors .CompileError as e :
@@ -623,7 +620,6 @@ def main() -> None:
623620 sigs = sigs ,
624621 class_sigs = class_sigs ,
625622 pyversion = options .pyversion ,
626- fast_parser = options .fast_parser ,
627623 no_import = options .no_import ,
628624 search_path = options .search_path ,
629625 interpreter = options .interpreter )
@@ -643,7 +639,6 @@ def parse_options() -> Options:
643639 doc_dir = ''
644640 search_path = [] # type: List[str]
645641 interpreter = ''
646- fast_parser = False
647642 while args and args [0 ].startswith ('-' ):
648643 if args [0 ] == '--doc-dir' :
649644 doc_dir = args [1 ]
@@ -658,8 +653,6 @@ def parse_options() -> Options:
658653 args = args [1 :]
659654 elif args [0 ] == '--recursive' :
660655 recursive = True
661- elif args [0 ] == '--fast-parser' :
662- fast_parser = True
663656 elif args [0 ] == '--ignore-errors' :
664657 ignore_errors = True
665658 elif args [0 ] == '--py2' :
@@ -682,8 +675,7 @@ def parse_options() -> Options:
682675 interpreter = interpreter ,
683676 modules = args ,
684677 ignore_errors = ignore_errors ,
685- recursive = recursive ,
686- fast_parser = fast_parser )
678+ recursive = recursive )
687679
688680
689681def default_python2_interpreter () -> str :
@@ -711,7 +703,6 @@ def usage() -> None:
711703 Options:
712704 --py2 run in Python 2 mode (default: Python 3 mode)
713705 --recursive traverse listed modules to generate inner package modules as well
714- --fast-parser enable experimental fast parser
715706 --ignore-errors ignore errors when trying to generate stubs for modules
716707 --no-import don't import the modules, just parse and analyze them
717708 (doesn't work with C extension modules and doesn't
0 commit comments