Re: new print function in interim release 660
Serge Orlov <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
Mark Hahn wrote: > The print keyword has been removed and replaced by a print function. Works like a charm. Feel free to move the next todo item (pretty print) down to ... interactive help(). This little useful function reminded me that interactive console is getting more and more complicated. Why not move it out of the core? The advantages: 1. Written in the sane language (not C) Mere mortals can hack it. I like currently handling of tabs and spaces in the console but compare it to http://codespeak.net/pyrepl/ 3. Less code in the core. 4. Not needed for most applications Here are other ideas: 1. On startup the core will read two variables (either from environment variables or from configuration file). These variables will be assigned to sys.console and sys.debugger The first is the name of the module for interactive console, the second is the name of the module for debugger for uncaught exceptions. If the configuration file is absent the names are 'interactiveConsole' and 'printTraceback' 2. If the interpreter wants to run the interactive console it does: import sys.console as InteractiveConsole InteractiveConsole.run() 3. If the interpreter found uncaught exception it will run: import sys.debugger as Debugger Debugger.debug(exception) 4. Application can change sys.debugger. Debugger can log the exception into file or show a window "Send report to Microsoft" :-) etc... 5. printTrackback.debug(...) will just print the exception like Python does. 6. sys.cons should be moved to console object -- Serge