[Python-checkins] python/dist/src/Modules cStringIO.c,2.42,2.43
skip at pobox.com
Mon Aug 11 10:37:40 EDT 2003
>>>>> "Just" == Just van Rossum <just at letterror.com> writes:
Just> montanaro at users.sourceforge.net wrote:
>> Modified Files:
>> Log Message:
>> shit - just change the visible name, not the comments - strictly
>> speaking, the tp_name is not correct, but what's exposed to users is
>> known visibly as "StringIO", not "StringI" or "StringO".
Just> And now there are two distinct types with the same name. What's
Just> the point of that?
Yes, but I believe those names are only used in stuff like tracebacks.
StringO and StringI are not documented as user-visible types:
>>> import cStringIO
['InputType', 'OutputType', 'StringIO', '__doc__', '__file__',
so displaying them in tracebacks is at best confusing. It's simply an
implementation detail that under the covers different types are used when
reading and writing:
On the other hand, I can see that this would be confusing:
>>> t = cStringIO.StringIO()
>>> s = cStringIO.StringIO("sdfsfd")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'cStringIO.StringIO' object has no attribute 'write'
whereas before my checkin the traceback would at least name a different
AttributeError: 'cStringIO.StringI' object has no attribute 'write'
Maybe my change was hasty. If so, mention of StringI and StringO should be
made in the StringIO/cStringIO docs.
More information about the Python-checkins