[issue21867] Turtle returns TypeError when undobuffer is set to 0 (aka no undo is allowed)

Raymond Hettinger report at bugs.python.org
Wed Jun 25 22:00:47 CEST 2014


Raymond Hettinger added the comment:

For the most part, we don't change exceptions once they are published in the standard library because it breaks any code that relies on those exceptions.  That is why it is so important to get the API correct to begin with.

TypeError was the wrong choice, it should has been a ValueError (the type is correct but the value doesn't make sense).   There is some case for a TurtleError (modules like decimal and sqlite3 define their own clusters of exceptions); however, that makes the exception less interoperable with the rest of Python where things like IndexError, StopIteration, ValueError, and KeyError get caught and handled appropriately.

----------
assignee:  -> rhettinger
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21867>
_______________________________________


More information about the Python-bugs-list mailing list