File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 88 Any ,
99 Dict ,
1010 List ,
11- Literal ,
1211 Mapping ,
1312 Optional ,
1413 Pattern ,
2726
2827
2928if typing .TYPE_CHECKING :
30- # requires Python 3.8
31- from typing import SupportsIndex
29+ # both require Python 3.8
30+ from typing import Literal , SupportsIndex
31+
32+ # simplified _OutputMethodArg from types-lxml
33+ _TostringMethodType = Literal [
34+ "html" ,
35+ "xml" ,
36+ ]
3237
3338
3439_SelectorType = TypeVar ("_SelectorType" , bound = "Selector" )
3540_ParserType = Union [etree .XMLParser , etree .HTMLParser ]
36- _TostringMethodType = Literal [ # simplified _OutputMethodArg from types-lxml
37- "html" ,
38- "xml" ,
39- ]
4041
4142lxml_version = parse_version (etree .__version__ )
4243lxml_huge_tree_version = parse_version ("4.2" )
@@ -346,8 +347,8 @@ def __init__(
346347 self ._csstranslator : OriginalGenericTranslator = typing .cast (
347348 OriginalGenericTranslator , _ctgroup [st ]["_csstranslator" ]
348349 )
349- self ._tostring_method : _TostringMethodType = typing .cast (
350- _TostringMethodType , _ctgroup [st ]["_tostring_method" ]
350+ self ._tostring_method : " _TostringMethodType" = typing .cast (
351+ " _TostringMethodType" , _ctgroup [st ]["_tostring_method" ]
351352 )
352353
353354 if text is not None :
You can’t perform that action at this time.
0 commit comments