Why can I derive a class from built-in types (e.g. lists or files)?
This is caused by the relatively late addition of (user-defined) classes to the language — the implementation framework doesn’t easily allow it. See the answer to question 4.2 for a work-around. This may be fixed in the (distant) future. —————————————————————————- 6.7. Why must ‘self’ be declared and used explicitly in method definitions and calls? By asking this question you reveal your C++ background. 🙂 When I added classes, this was (again) the simplest way of implementing methods without too many changes to the interpreter. I borrowed the idea from Modula-3. It turns out to be very useful, for a variety of reasons. First, it makes it more obvious that you are using a method or instance attribute instead of a local variable. Reading “self.x” or “self.meth()” makes it absolutely clear that an instance variable or method is used even if you don’t know the class definition by heart. In C++, you can sort of tell by the lack of a local