Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Or it would have to inherit the method from a common iterator class. Which gets to the heart of the Ruby/Python thing: In Python inheritance just isn't as stressed, since people prefer duck-typing to isinstance. On the other hand, since you can reopen classes in Ruby, it's not as crazy to use the modification of a common base class as a means of making a method work with a wide variety of object types.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: