Add attribute 'name' to StringIO (#600)

Add an attribute 'name' of type str to StringIO.StringIO in python2
and io.StringIO in python2 and python3.

Fixes #598.
This commit is contained in:
Eklavya Sharma
2016-10-12 20:04:58 +05:30
committed by Matthias Kramm
parent 08ac3b7742
commit 7f7a5789bd
3 changed files with 3 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ class StringIO(IO[AnyStr], Generic[AnyStr]):
closed = ... # type: bool
softspace = ... # type: int
len = ... # type: int
name = ... # type: str
def __init__(self, buf: AnyStr = ...) -> None: ...
def __iter__(self) -> Iterator[AnyStr]: ...
def next(self) -> AnyStr: ...

View File

@@ -49,6 +49,7 @@ class StringIO(TextIO):
def __init__(self, initial_value: unicode = ...,
newline: unicode = ...) -> None: ...
# TODO see comments in BinaryIO for missing functionality
name = ... # type: str
def close(self) -> None: ...
def closed(self) -> bool: ...
def fileno(self) -> int: ...

View File

@@ -246,6 +246,7 @@ class TextIOWrapper(TextIO):
class StringIO(TextIOWrapper):
def __init__(self, initial_value: str = ...,
newline: Optional[str] = ...) -> None: ...
name = ... # type: str
def getvalue(self) -> str: ...
class IncrementalNewlineDecoder(codecs.IncrementalDecoder): ...