On 2018-09-30 10:45, Anders Hovmöller wrote: > >>> I am roughing out such a class and some test cases which will hopefully >>> include some cases where the hoped for advantages can be realised. >>> >>> My thinking on bitwise operations is to do the same as arithmetic >>> operations, i.e. (anything op iNaN) = iNaN and likewise for shift >>> operations. >> Steve, >> >> While you are extending a number system, can every int be truthy, while >> only iNan be falsey? I found that behaviour more useful because >> checking if there is a value is more common than checking if it is a >> zero value. > I’m not saying you’re wrong in principle but such a change to Python seems > extremely disruptive. And if we’re talking about robustness of code then > truthiness would be better like in Java (!) imo, where only true is true and > false is false and everything else is an error. If we’re actually talking > about changing the truth table of Python for basic types then this is the > logical next step. > > But making any change to the basic types truth table is a big -1 from me. > This seems like a Python 2-3 transition to me.
Sorry, I can see I was unclear: I was only asking that the new number system (and the class that implements it) have truthy defined differently. My imagination never considered extending ints with iNaN. I would imagine the iNaN checks on every int operation to be noticeably slower, so out of the question. _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/