Tim Hochberg (el 2006-12-20 a les 09:20:01 -0700) va dir:: > Actually, this is on purpose. Numpy.where (and most other switching > constructs in Python) will switch on almost anything. In particular, any > number that is nonzero is considered True, zero is considered False. By > changing the signature, you're restricting where to only accepting > booleans. Since booleans and ints can by freely cast to doubles in > numexpr, always using float for the condition saves us a couple of opcodes. > [...]
Yes, I understand the reasons you expose here. Nou you brought the topic about, I'm curious about what does "always using float for the condition saves us a couple of opcodes" mean. Could you explain this? Just for curiosity. :) :: Ivan Vilata i Balaguer >qo< http://www.carabos.com/ Cárabos Coop. V. V V Enjoy Data ""
signature.asc
Description: Digital signature
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion