-
-
Notifications
You must be signed in to change notification settings - Fork 245
Cannot show most source code #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What I wrote was so wrong I'm deleting it - I'm looking into how IPython handles this.
|
Reading your comment, it may be that there are two issues at play here. I saw the bug (i.e. bpython not showing the source) when I entered those lines in the interpreter AS WELL AS when I loaded those methods from a file on disk. |
Oh huh - not sure what that's about. Loading them from a file is working fine for me now. But generally we should certainly do a better job finding those methods - I'll take a look at what IPython is doing. |
Please see this example output:
Does that work for you? For me it doesn't show any source. |
I can reproduce in 0.13 bpython-curtsies, but not in plain bpython 0.13, bpython master, or bpython-curtsies master. What are you using? |
Strange, I'm pretty sure I'm calling it exactly like it is shown in the snippet above. I was under the impression that by calling |
Can I give any other information to help debug this? |
Is this on master, the latest release (0.13) or something else? I agree, |
@dwt I'm not sure what else would be useful - your post is pretty clear, I just can't replicated it. Maybe doing a fresh install of either master or stable 0.13 and confirming? |
% bpython --version |
bpython was installed via |
Something that might be relevant: Function keys are pretty heavily overloaded on macs, and it might be that one of those overloadings prevents the key from reaching the shell. (I'm not sure how I can test that though?) Still, it would be very helpful if all the functions advertised at the bottom of the screen hat non function key alternatives. (Maybe they do and I just haven't found the docs?) |
Jus retested this with the bpython master branch, where I still see the same problem. However, after exiting from bpython, I see this output:
which seems to suggest that bpython was indeed able to to get the source, but instead failed to display it. Does that perhaps help pinning this down? The way I tested:
|
This is terrific, thanks! I'll look into this tonight. |
It looks like bpython is might be using whatever your environmental variable $PAGER is - do you have something unusual in there, like |
Hm... as far as I can tell my less is pretty straight forward:
I do have this though, maybe that can cause some problems?
|
This is caused by I'm closing this issue for now and will add something about it to the documentation. |
Out of interest, is there any reason that the bpython screen is immediately redrawn after the pager exits? If bpython would react more like my shell, then it could show the output of the pager inline until I scrolled it out of the buffer by my bpython interaction. If I'm not mistaken, that should make bpython handle this output the same way a shell would, which should be very compatible and stable. |
Hm, so maybe bpython capture stdout of less and print it out? I like thinking of all the special functionality of bpython (save, show source, open in editor, etc.) as being out-of-band; bpython is a Python interpreter with some overlays. Therefore I don't want results from these in history, I want to pretend they never happened. Curious to hear what other people think. |
I have to say that the way I use less in my shell is very much as a tool that allows me easy navigation inside a file that I'm viewing - not as something I switch to outside of the shell that is then deleted when it exits. I think that is really a different way to use pagers that could (should?) be supported by my python shell of choice. |
Some examples:
Both of these work fine in iPython. Putting these two definitions in a file and importing them yields the same result - source does not show.
These are reduced examples, in my testing I noticed that I could show the source of a whole class in my project, but I wasn't able to show most of the methods on it. Some examples: properties, decorated methods, inherited methods.
Not sure whats the reason for this, but iPython did work for those most of the time, so it may be a good idea to fork their method source lookup code and use it instead of what is in bpython right now.
The text was updated successfully, but these errors were encountered: