[Python-Dev] Are undocumented exceptions considered bugs?
stefan.bucur at gmail.com
Wed Apr 3 12:47:28 CEST 2013
On Sun, Mar 24, 2013 at 2:09 AM, Devin Jeanpierre <jeanpierreda at gmail.com>wrote:
> On Sat, Mar 23, 2013 at 11:21 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> > In this specific case, the error message is
> > confusing-but-not-really-wrong, due to the "two-types-in-one" nature
> > of Python 2.x strings - 8-bit strings are used as both text sequences
> > (generally not containing NUL characters) and also as arbitrary binary
> > data, including encoded text (quite likely to contain NUL bytes).
> With your terminology, three types: char, non-NUL-text, encoded-text
> (e.g. what happens with ord('ab'))
> That's pretty silly, considering that these are all one Python type,
> and TypeError is raised into Python code. Obviously it can't change,
> because of historical reasons, but documenting it would be
> straightforward and helpful. These are not errors you can just infer
> will happen, you need to see it via documentation, reading the source,
> or experimentation (and re experimentation, then you have to establish
> whether or not this was an accident or deliberate).
Thanks for your answers, guys, and sorry for replying so late (had a
research paper submission deadline in the mean time...). Filing a bug
report for this issue sounds like a good idea. I have just submitted
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-Dev