What's better about Ruby than Python

Avery Andrews andrews at pcug.org.au
Wed Aug 20 07:40:34 CEST 2003


John J Lee wrote:
>I mostly agree, but I think you could be accused of spreading FUD
>about this.  Does anybody *really* choose to alter string-comparison
>semantics under everybody else's nose in Ruby??  That would be like
>doing
>
>import some_module
>
>def evil_replacement_function(): return blah()
>
>some_module.important_function = evil_replacement_function
>
>
>in Python, wouldn't it?

Hmm, Armin Rigo's first major Python project (the Quake engine game map
editor QuArK) makes extensive use of this technique, but rigorously
folloiwng the convention that evil_replacement_function always calls
some_module.important_function and then does more besides, such as add
more items to a menu, draw more lines on a map, or whatever.  So used, it
seems to work well and not cause problems (maybe it's a way of faking
aspects of aspect-oriented programming).

  Avery Andrews







More information about the Python-list mailing list