Paul F Dubois <paul@pfdubois.com>: >Making a module dictionary readonly after importation would break legendary >amounts of code. Perhaps a way round this would be to flag modules in some way. For example, an export statement with the following semantics: - Has the form "export name1, name2, name3" - Exported names must be bound in the module body (at some point after the export statement) - Export statements must appear before any others (apart from doc strings and comments) - The presence of the export statement makes binding or unbinding names in the module's dict illegal after the module has been loaded - Only exported names can be imported into other modules (in the same way as before - i.e. export would NOT imply automatic insertion into other namespaces) - No export statements means use the current rules (everything exported, module dict stays writable) I think this would be an intuitively obvious addition, and these rules would mean that the compiler would be free to make assumptions about the meaning of builtins etc in a module. Mark
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4