make xml.etree.ElementTree.Element a Sequence (#254)

This commit is contained in:
James J Porter
2016-06-04 22:28:22 -04:00
committed by Guido van Rossum
parent a581397c42
commit 2b55989f7d
6 changed files with 6 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ class ParseError(SyntaxError): ...
def iselement(element: 'Element') -> bool: ...
class Element:
class Element(Sequence['Element']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]

View File

@@ -21,7 +21,7 @@ class ParseError(SyntaxError): ...
def iselement(element: 'Element') -> bool: ...
class Element:
class Element(Sequence['Element']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]

View File

@@ -15,7 +15,7 @@ _Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class Element:
class Element(Sequence['Element']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]

View File

@@ -15,7 +15,7 @@ _Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class Element:
class Element(Sequence['Element']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]

View File

@@ -15,7 +15,7 @@ _Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class Element:
class Element(Sequence['Element']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]

View File

@@ -11,7 +11,7 @@ _Ss = TypeVar('_Ss', str, bytes)
_T = TypeVar('_T')
_str_or_bytes = Union[str, bytes]
class _ElementInterface:
class _ElementInterface(Sequence['_ElementInterface']):
tag = ... # type: _str_or_bytes
attrib = ... # type: Dict[_str_or_bytes, _str_or_bytes]
text = ... # type: Optional[_str_or_bytes]