Guido wrote: > Moshe proposes to add an overridable function sys.displayhook(obj) > which will be called by the interpreter for the PRINT_EXPR opcode, > instead of hardcoding the behavior. The default implementation will > of course have the current behavior, but this makes it much simpler to > experiment with alternatives, e.g. using str() instead of repr() (or > to choose between str() and repr() based on the type). hmm. instead of patching here and there, what's stopping us from doing it the right way? I'd prefer something like: import code class myCLI(code.InteractiveConsole): def displayhook(self, data): # non-standard display hook print str(data) sys.setcli(myCLI()) (in other words, why not move the *entire* command line interface over to Python code) </F>
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