py-complete does not work on variables, only on module namespaces
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
New
|
Wishlist
|
Andreas Roehler |
Bug Description
py-shell-complete and py-complete work well on namespaces like numpy, cv2, matplotlib.pyplot , however, on variables only py-shell complete seems to work.
Consider the following example:
import numpy as np
x = np.array([1]) # completion works in the intermediate string x = np.arr with both py-complete and py-shell-complete.
However,
when attempting to complete
x.s # here only py-shell-complete gets all of the completions for this variable
Possible completions are:
x.swapaxes x.sum x.strides x.std
x.squeeze x.sort x.size x.shape
x.setflags x.setfield x.searchsorted
whereas py-complete returns nothing.
The caveat is that py-shell-complete also fails if there is no *IPython* shell buffer open where my whole script ran. This sort of makes sense but I am wondering whether it would be possible to do everything in a separate, invisible shell.
Attempting to run py-documentation on the string 'x.shape' or any other function fails. Maybe this should be fixed? when running py-documentation on 'x = np.array' it works very well.
My question is: can py-complete work on variable names too? If not, how can I use py-shell-complete's list of completion to be passed to ac-sources. py-complete has the variable ac-sources-
Changed in python-mode: | |
assignee: | nobody → Andreas Roehler (a-roehler) |
importance: | Undecided → Low |
importance: | Low → Medium |
Changed in python-mode: | |
importance: | Medium → Wishlist |
Is there any plan to add the py-shell-complete sources to the ac-sources list? I wish i'd knew how to do it, because py-shell complete seems more robust than py-complete