On Fri, Oct 7, 2011 at 9:21 AM, "Martin v. Löwis" <mar...@v.loewis.de> wrote: > > if (!PyUnicode_READY(foo)) is not better, also because of >> >> PyUnicode_IS_READY(foo). >> >> I prefer PyUnicode_IS_READY(foo) < 0 over PyUnicode_IS_READY(foo) == -1. >> > > Ok, so feel free to replace all == -1 tests with < 0 tests as well. > > I'll point out that the test for -1 is also widespread in Python, > e.g. when checking return values from PyObject_SetAttrString, > BaseException_init, PyThread_create_key, PyObject_DelAttrString, etc.
FWIW, I don't mind whether it's "< 0" or "== -1", so long as there's a comparison there to kick my brain out of Python boolean logic mode. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com