PyWart: Python modules are not so "modular" after all!
rantingrickjohnson at gmail.com
Mon Nov 11 05:13:45 CET 2013
The Pros of Python Modules:
Python modules require no special syntax to create, nor do
they induce extra indentation in your source code to
maintain readability. Simply write some Python code in an
editor, save it with a py|pyw extension, throw in a
directory that python can find, and WHAMO, you've got
yourself an importable module namespace!
Of all the package implementations i've seen, Python's use
of the source file as a module is absolutely my favorite
But don't pucker up your benevolent anus just yet!
The Cons of Python Modules:
1. Modules cannot be extended or manipulated by the
programmer. Basically the PyGods have handed us modules,
but they failed to give us any tools to manipulate them --
heck, they might as well have blessed us an unlimited
supply of high carbon steel but cursed us with an
atmosphere that does not support combustion.
What good is ANY namespace when you cannot override it's
fundamental interface? And interfaces are the key to OOP!
Is __setattr__/__getattr__ ringing a bell people?
More information about the Python-list