> Hmm, so you do want exceptions to be raised for coercion errors > during compare ? Sure, fine. > For the record: > PyObject_Compare() currently only does coercion for number > slot compatible types (ok, all Python instances have these > slots...). Unicode objects are handled in a special case to > allow the PyUnicode_Compare() API to do all necessary conversions > and then proceed with the compare. > > The coercion proposal will have to deal with all this in 2.1. > > My version of the proposal (see Python Pages) puts all the power > into the hands of the operators themselves rather than using > a centralized coercion method. In this scenario, the special > casing in PyObject_Compare() for Unicode would no longer > be necessary, since the Unicode compare slot could then take > care of the needed conversions (essentially PyUnicode_Compare() > would beceom that slot). This all sounds okay to me -- I've signed off on that design (in principle) years ago... --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4