Georg Brandl added the comment:
Okay, then I see this as a intended feature.
--
resolution: - wont fix
status: open - closed
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1986
__
Rafael Zanella added the comment:
oops, stupid me, this a 3.0 issue..., well seems the str() conversion is
done as well on the 3.0 io module:
class StringIO(TextIOWrapper):
def __init__(self, initial_value=, encoding=utf-8,
errors=strict, newline=\n):
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 =
Christian Heimes added the comment:
In Python 2.x StringIO.StringIO calls str() on its arguments:
StringIO.StringIO(1).read()
'1'
StringIO.StringIO(object).read()
type 'object'
str(object)
type 'object'
io.StringIO has the same behavior:
io.StringIO(1).read()
'1'
New submission from Georg Brandl:
x = io.StringIO(1)
x.read()
'1'
--
components: Extension Modules
messages: 61957
nosy: georg.brandl
priority: high
severity: normal
status: open
title: io.StringIO allows any parameter
type: behavior
versions: Python 3.0