On 12/22/2013 06:33 PM, Steven D'Aprano wrote:
Roy Smith wrote:else: assert 0, "can't create picker (classes = %s)" % classes¡Ay, caramba! I was with you until the very last line. The above code is possibly buggy and inappropriately designed. [...] First, the bug: there are circumstances where no exception is raised even if all the strategies fail.
Since Steven wasn't explicit about the circumstances, I'll list the two I'm aware of: if Python is started with -O or -OO then assertions are cut from the code and do not run:
ethan@media:~/source/python/issue19995$ ./python -O Python 3.4.0b1 (default:be22ffb4fdf1, Dec 20 2013, 12:26:10) [GCC 4.7.3] on linux Type "help", "copyright", "credits" or "license" for more information. --> assert 0, "Testing" --> # no exception raised -- https://mail.python.org/mailman/listinfo/python-list
