newbie code complete question
hello and thanks in advice
s i said i'm a newbie with pycharm and i have a silly question
about code complete.
fh = open('test.txt')
fh.
if i try to popup the code completion box typing ctrl,space after fh.
i'm getting the message "No suggestion"
i can't understand what's happen, i think it's my fault
but i can't understand what i did wrong.
Looking in the settings, the python interpreter configuration contains 2 versions of python
2.7.2
and 3.2.2
with the defaults path in the box above
Could someone give me an advice about what is going wrong.
thanks
fabio
请先登录再写评论。
If you press "Goto Definition" (Ctrl-B) on open, do you get to its definition in __builtin__.py?
thanks Dmitry for your answer
yes if i click on open i go to the definition
...
def open(file, mode='r', buffering=None, encoding=None, errors=None, newline=None, closefd=True): # known special case of open
.....
Fabio
today i've installed 2.0.2
and repeated the test obtaining the same results.
Can i check something on the settings?
i've already verified settings about python interpreters and the code complete options with no luck.
Fabio
Please check the type of the variable fh:
fh = open('foo')
print(fh) # Press Ctrl and move the mouse over 'fh'
The inferred type should be 'file' or 'TextIOWrapper'. If it isn't, then go to the definition of 'open' by Ctrl+clicking on it and post the full body of 'open' here.
Thaks for your answer Andrey
first of all, i forgot to mention that i'm running pycharm 2.0.2 on windows7 64bit also python 3.2.2 is 64bit.
if i print print(type(fh))
the result is <class '_io.TextIOWrapper'>
fh = open(file)
hitting ctrl and moving the mouse over fh doesn't produce any output
if i do the same with open the method signature appear
when i go to the definition of open(..)
a file called builtins.py opens , the method signature :
def open(file, mode='r', buffering=None, encoding=None, errors=None, newline=None, closefd=True):
Fabio, this bug is specific to Python 3.x and PyCharm 2.0.x. It will be fixed in PyCharm 2.1.