[issue1986] io.StringIO allows any parameter

Rafael Zanella report at bugs.python.org
Sun Feb 24 22:57:04 CET 2008


Rafael Zanella added the comment:

I believe you're referring to StringIO, if so, it changes the parameter
received to a string:

"""
class StringIO:
  def __init__(self, buf = ''):
        # Force self.buf to be a string or unicode
        if not isinstance(buf, basestring):
            buf = str(buf)
"""

----------
nosy: +zanella

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1986>
__________________________________


More information about the Python-bugs-list mailing list