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

6 comments
Comment actions Permalink

If you press "Goto Definition" (Ctrl-B) on open, do you get to its definition in __builtin__.py?

0
Comment actions Permalink

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

0
Comment actions Permalink

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

0
Comment actions Permalink

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.

0
Comment actions Permalink

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):

the body is made of comments and a pass statement,
i'm sorry last time i've looked at this method i didn't read the body.
fabio
0
Comment actions Permalink

Fabio, this bug is specific to Python 3.x and PyCharm 2.0.x. It will be fixed in PyCharm 2.1.

0

Please sign in to leave a comment.