MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/_pyio.py:2737–2751  ·  view source on GitHub ↗
(self, initial_value="", newline="\n")

Source from the content-addressed store, hash-verified

2735 """
2736
2737 def __init__(self, initial_value="", newline="\n"):
2738 super(StringIO, self).__init__(BytesIO(),
2739 encoding="utf-8",
2740 errors="surrogatepass",
2741 newline=newline)
2742 # Issue #5645: make universal newlines semantics the same as in the
2743 # C version, even under Windows.
2744 if newline is None:
2745 self._writetranslate = False
2746 if initial_value is not None:
2747 if not isinstance(initial_value, str):
2748 raise TypeError("initial_value must be str or None, not {0}"
2749 .format(type(initial_value).__name__))
2750 self.write(initial_value)
2751 self.seek(0)
2752
2753 def getvalue(self):
2754 self.flush()

Callers

nothing calls this directly

Calls 6

superClass · 0.85
BytesIOClass · 0.85
__init__Method · 0.45
formatMethod · 0.45
writeMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected