4 ms·
I agree, I quite like it as a method as it keeps its congruence with .include? as an opposite of .in? (what .in? does should have been what .include? did from t
by kelseydh 11y ago
I agree, I quite like it as a method as it keeps its congruence with .include? as an opposite of .in? (what .in? does should have been what .include? did from the get go).
Perhaps another way of doing this is calling the method .within?
- tragomaskhalos 11y agoSeconded. One of the ways in which I prefer Ruby to Python is the way that it always favours "plain methods" over "syntax that maps to special methods under the covers".
- omaranto 11y agoBut that's not true, as far as I can tell. Ruby does allow you to write 5.+(8), but as far as I can tell most people prefer 5+8. Ruby also has special syntax for <, == and indexing arrays. What things does Python have special syntax for that Ruby doesn't? Off the top of my head I can only remember "in".