Steven D'Aprano <[EMAIL PROTECTED]> writes: > The fact that sys is a module and not a class is a red herring. If the > "Law" of Demeter makes sense for classes, it makes just as much sense for > modules as well -- it is about reducing coupling between pieces of code, > not something specific to classes.
I don't see that. If a source line refers to some module you can get instantly to the module's code. But you can't tell where any given class instance comes from. That's one of the usual criticisms of OOP, that the flow of control is obscured compared with pure procedural programming. > One dot good, two dots bad. Easy to fix. Instead of sys.stdout.write(...) say from sys import stdout from then on you can use stdout.write(...) instead of sys.stdout.write. -- http://mail.python.org/mailman/listinfo/python-list