Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upbpython could pprint by default #34
Comments
|
Thank you for the workaround. Interactive shells are typically used for exploration or debugging. Debugging typically involves poring over large amounts of structured data. One good reason to be using bpython instead of ipython is because bpython supports invocation with app args (as it is intended to be a simple replacement for the python REPL), and ipython does not. The workaround could be added to my code, but part of the point of using a tool beyond the normal python REPL is useful extra functionality. Closing feature requests on open source projects is bad form, unless it's reasonable to say "this feature will never enter the codebase, as it not feasible or conflicts with the purpose of the project". This feature appears to be neither impossible or against the goals of bpython. |
|
@Trundle This works, except when -i option is used to load a script file for interactive development/testing. would appreciate a better solution. |
|
Bump! Original Comment By: Jose Quesada |
|
This can be easily done with a startup file. bpython executes, just like vanilla python, the content of the file identified by the //PYTHONSTARTUP// environment variable. So, creating a file containing {{{ def displayhook(value): and setting //PYTHONSTARTUP// to it will work fine. Therefore, I do not see a reason to force that into bpython because users can easily customise bpython themselves if they want to. Perhaps we should mention that in the documentation or create some kind of //"tips & tricks"// wiki page. Original Comment By: Andreas Stührk |
|
Sadly it took me some effort to get this to work. I don't see why BPython can't offer a convienience setting for this, instead of having to work through Python Internals. IPython does offer it:
|
It would be nice if bpython could pprint the output by default. In an interactive interpreter, pretty printing things is much better, than the default printing.
Of course, this could be configurable for people that don't like pretty things. :)