Extra closing parenthesis added after new line
See original GitHub issueDescription
What steps will reproduce the problem?
Versions
Python 3.7.4 Spyder 4.0.0
Issue
Automatic insertion of parentheses, braces and brackets: ON
An extra closing parenthesis is added when typing over the auto-added parenthesis. This happens when working inside a previous bracket.
Reproduce
import pandas as pd
df = pd.DataFrame({
'a': [1, 2, 3],
'b': [4, 5, 6]
})
def paren_example():
return( # Hit return
df['a'].max())) # Extra parenthesis added when typing .max()
Versions
- Spyder version: 4.0.0
- Python version: 3.7.4
- Qt version: 5.9.6
- PyQt5 version: 5.9.2
- Operating System: Windows 10
Dependencies
cloudpickle >=0.5.0 : 1.2.2 (OK)
pygments >=2.0 : 2.5.2 (OK)
qtconsole >=4.6.0 : 4.6.0 (OK)
nbconvert >=4.0 : 5.6.1 (OK)
sphinx >=0.6.6 : 2.3.0 (OK)
pylint >=0.25 : 2.4.4 (OK)
psutil >=0.3 : 5.6.7 (OK)
qtawesome >=0.5.7 : 0.6.0 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
zmq >=17 : 18.1.0 (OK)
chardet >=2.0.0 : 3.0.4 (OK)
numpydoc >=0.6.0 : 0.9.1 (OK)
spyder_kernels >=1.8.1;<2.0.0: 1.8.1 (OK)
qdarkstyle >=2.7 : 2.7 (OK)
atomicwrites >=1.2.0 : 1.3.0 (OK)
diff_match_patch >=20181111 : 20181111 (OK)
intervaltree : None (OK)
watchdog : None (OK)
keyring : None (OK)
pexpect >=4.4.0 : 4.7.0 (OK)
pympler : None (OK)
sympy >=0.7.3 : 1.5 (OK)
cython >=0.21 : 0.29.14 (OK)
IPython >=4.0 : 7.10.2 (OK)
matplotlib >=2.0.0 : 3.1.1 (OK)
pandas >=0.13.1 : 0.25.3 (OK)
numpy >=1.7 : 1.17.4 (OK)
scipy >=0.17.0 : 1.3.2 (OK)
pyls >=0.31.2;<0.32.0 : 0.31.2 (OK)
rtree >=0.8.3 : 0.8.3 (OK)
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Why is it customary to put many closing parentheses on one ...
It allows adding and removing "another-thing" lines more easily (without removing and re-adding trailing closing parenthesis). Also you can put ...
Read more >Extra newline added before closing branch when pressing ...
Issue Description When typing C# code I often place my cursor between a pair of (normal?) brackets ()and press enter.
Read more >Putting extra brackets around equation adds whitespace to ...
The closing bracket seems to start a new paragraph. Add \noindent : ... Hello % there's an extra space before Hello \end{document}.
Read more >Breaking up long lines of code in Python
Let's talk about breaking up long lines of code in Python. How to continue code on the next line. The import statement below...
Read more >Code Style. PHP | PhpStorm Documentation - JetBrains
If selected, a space is inserted before the opening parenthesis in ... Otherwise, such comments will align with the next line of code....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, please do.
@dalthviz Yes I was able to. It happens when typing over the closing parenthesis in “.max()”. Usually when I type over auto-generated parenthesis, it understands that parenthesis was already created, and does not duplicate it. Unless you are using the arrow key to skip over the closing parenthesis?