3 ms·
Python is not even the best example here, in Common Lisp and Perl (and probably lots of other languages) provide even better abstractions. If you want to modif
by jrockway 17y ago
Python is not even the best example here, in Common Lisp and Perl (and probably lots of other languages) provide even better abstractions. If you want to modify the behavior of one accessor, you can modify it with method modifiers. If you want to create a new class of accessor-generation behavior, you can write a new metaclass that works exactly the way you want. (And of course, you can write your own "defclass" macro that always uses your own metaclass, if you desire.)
In Perl, we can even compose meta-roles into metaclasses; meaning that even tiny changes can be made easily reusable.
This is generally preferable to editing code in an IDE.
- adw 17y agoYou can do the __metaclass__ thing in Python too. We'll find you and tut at you if you do, but you can do it.