-
Notifications
You must be signed in to change notification settings - Fork 47
REPL Support
Yao Zuo edited this page Apr 4, 2017
·
1 revision
Other than default Python REPL, pdir2 support several popular REPLs in the Python world, including ipython, ptpython, bpython and Jupyter Notebook. Among these REPLs, pdir2 behaves differently in ptpython.
Normally, when you type pdir(obj)
in a REPL, pdir(obj).__repr__
will be called and the string representation is returned. in ptpython, pdir(obj)
does not return the string representation, instead, it prints the string representation directly then returns ''
. To get the string representation, you should use the repr_str
attribute. Example:
- Currently, due to a bug in bpython, pdir2 doesn't work so well with it. I hope we can find a nice solution for this and bring satisfaction to bpython users.
- Since Python IDLE on Windows doesn't support color printing, pdir2 won't work on i