Skip to content

Indentation Error does not occur when no value is entered after for #1385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HyeockJinKim opened this issue Sep 17, 2019 · 4 comments
Closed
Labels
C-compat A discrepancy between RustPython and CPython

Comments

@HyeockJinKim
Copy link
Contributor

Feature

Expected Result

>>> for i in range(10):
... 
  File "<stdin>", line 2
    
    ^
IndentationError: expected an indented block

Actual Result

>>>>> for i in range(10):
..... 
..... 
..... 
..... 
..... 
..... 
..... 

In the python3 shell, if no value is entered when Indentation is required, (such as for: or if: or def, etc...), an IndentationError should be raised.

@HyeockJinKim HyeockJinKim added the C-compat A discrepancy between RustPython and CPython label Sep 17, 2019
@coolreader18
Copy link
Member

Hmm, maybe we could check if the previous syntax error was in the same place as the current one, and if it was then give an error?

@dralley
Copy link
Contributor

dralley commented Oct 2, 2019

Right now it looks like there is no IndentationError at all. Likewise, TabError doesn't exist.

@dralley
Copy link
Contributor

dralley commented Oct 2, 2019

Using the following input from StackOverflow

command = "IDENTIFY"

if command == 'HOWMANY':
    opcodegroupr = "A0"
    opcoder = "85"
elif command == 'IDENTIFY':
opcodegroupr = "A0"
opcoder = "81"

Expected

  File "test2.py", line 7
    opcodegroupr = "A0"
               ^
IndentationError: expected an indented block

Actual

SyntaxError: Got unexpected token 'opcodegroupr' at line 7 column 1

@sanxiyn
Copy link
Contributor

sanxiyn commented Oct 11, 2019

I implemented IndentationError, but it does not resolve the original issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-compat A discrepancy between RustPython and CPython
Projects
None yet
Development

No branches or pull requests

4 participants