|
|
|
|
|
by jasonkeene
5192 days ago
|
|
So web2py introduces new members to __builtins__? Coming from a general Python programmer with no "vested interest" I have to say that isn't the best of ideas. len/dict/list are builtins because they are part of the language. They can be assumed to be present in any Python program. Teaching people that these web2py objects are available globally w/o importing them is setting a false expectation. This is pretty much monkey patching even if you aren't overriding stuff. Generally a no-no in the Python community. With great power comes great responsibility. |
|
People like you who have never actually used web2py routinely express concern that this will somehow set up false expectations and confuse people about how Python modules and imports work, but in practice this is simply not the case. Note, web2py also includes a number of modules that require explicit importing, and applications can include their own modules as well as import standard library and third-party modules. As a result, web2py developers are perfectly comfortable with normal Python imports and do not have any false expectations.
Web2py is indeed using its "great power" responsibly.