1

As the title says, when using autocomplete in Pycharm the only autocomplete option shown is: print(args,kwargs) builtin

I expect autocomplete to complete with "print" as this is what I usually use. I'm using Pycharm version 4.06 and anaconda python 2.7.

clurhur
  • 81
  • 6
  • pycham does autocompletion on functions. In Python 2 `print` is a statement, not a function. – cdarke Apr 14 '15 at 07:39
  • So in order to not have print turn into print() after pressing space I need to turn off autocomplete? – clurhur Apr 14 '15 at 07:41
  • 2
    print("string") also works on Python v2.7 so my guess is that they are trying to encourage you to make code future-compatible with v3.3. [Reading Material](http://stackoverflow.com/questions/6182964/why-is-parenthesis-in-print-voluntary-in-python-2-7) – MaxQ Apr 14 '15 at 07:42
  • I've just checked and @cdarke code completion with space also completes variable names.. – clurhur Apr 14 '15 at 07:47
  • thanks for the link @MikeFoxtrot, print as a function and not a special statement does make more sense. I'm just so used to using it as a statement I was surprised by this behaviour in pycharm. – clurhur Apr 14 '15 at 07:56
  • I advice you to àdd `from __future__ import print_function` first line of your script to prepare the migration to Python 3.4. – Vivian De Smedt Apr 14 '15 at 09:35

1 Answers1

1

I have turned off autocomplete with space under Preferences>Editor>General>Code Completion, checkbox "Insert selected variant by typing dot, space. etc." This way I can still autocomplete with the Tab key and just type "print" and not have it turn into "print()" when hitting space. While this answer does not make autocompletion of print possible, it might be helpful for others who are more used to "print" than "print()".

clurhur
  • 81
  • 6