3 ms·
I mean, that's not technically true, there's definitely a module system. In fact, in some ways Ruby's module system is more powerful than Python's since it's co
by hetman 9y ago
I mean, that's not technically true, there's definitely a module system. In fact, in some ways Ruby's module system is more powerful than Python's since it's completely divorced from the concept of the file. You can split a single module across multiple files or create multiple modules in a single file. You can nest modules as well of course.
The problem is with the module import system, which as you alluded, imports the module structure in a given file into the global namespace. And it imports everything! There's simply no way to say which bits you want and where they should go.
I actually don't really see a reason why the import system could not be changed while keeping the module system in general as is. I wonder if anyone has ever tried something like that...