mirror of
https://github.com/davidhalter/parso.git
synced 2026-02-13 21:52:42 +08:00
Help the type checker a bit with recursive type definitions
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import hashlib
|
||||
import os
|
||||
from typing import Generic, TypeVar, Union, Dict, Optional, Any
|
||||
from typing import Generic, TypeVar, Union, Dict, Optional, Any, Iterator
|
||||
from pathlib import Path
|
||||
|
||||
from parso._compatibility import is_pypy
|
||||
@@ -8,7 +8,7 @@ from parso.pgen2 import generate_grammar
|
||||
from parso.utils import split_lines, python_bytes_to_unicode, \
|
||||
PythonVersionInfo, parse_version_string
|
||||
from parso.python.diff import DiffParser
|
||||
from parso.python.tokenize import tokenize_lines, tokenize
|
||||
from parso.python.tokenize import tokenize_lines, tokenize, PythonToken
|
||||
from parso.python.token import PythonTokenTypes
|
||||
from parso.cache import parser_cache, load_module, try_to_save_module
|
||||
from parso.parser import BaseParser
|
||||
@@ -223,7 +223,7 @@ class PythonGrammar(Grammar):
|
||||
)
|
||||
self.version_info = version_info
|
||||
|
||||
def _tokenize_lines(self, lines, **kwargs):
|
||||
def _tokenize_lines(self, lines, **kwargs) -> Iterator[PythonToken]:
|
||||
return tokenize_lines(lines, version_info=self.version_info, **kwargs)
|
||||
|
||||
def _tokenize(self, code):
|
||||
|
||||
Reference in New Issue
Block a user