I use PyCharm to write python code and notice that I often encounter the following problem:
I am writing a line of code like this
for item in myList:
Later, I understand that I need an item index, so I'm trying to turn this string into this:
for i,item in enumerate(myList):
To rotate the first line to the second, I placed the cursor to the left of item and typed i, Then I placed the cursor to the left of myList and typed enu ; by this time the code-add. suggests that I can type enumerate , which is exactly the behavior I use. When I pressed tab to implement the proposed enumerate , I noticed that my string turns into
for i,item in enumerate:
myList been overwritten!
The behavior I expect is as follows:
for i,item in enumerate(myList):
with the cursor immediately to the right of myList or :
Is there any way to get Pycharm to behave according to my expectations?
Just in case it matters, my environment for developers is Mac OSX 10.7.5 (Lion)
source share