Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
MultiLine comments not working - bug?

Hi,

I've tried using the python multiline comments and the IDE looses context when they are inserted into some code. Is this a bug?

Code:

if ( a < 10 ):  
        a = a + 1  
"""
Comment  
"""
        if ( someThing ):  

Error:

6 Error SyntaxError: unexpected indent

where line is "if ( someThing ):" (NB. the indents are correct!!)

Has anyone else tested this?

Cheers,
Andrew

2 responses

I tried this in a local IDE and got the same error, only # comments can have incorrect indentation. It looks pretty terrible anyway, so I'm not opposed to the syntax error : )

# This is no good

def thing():  
    msg = 'hi'  
'''
prints hi  
'''
    print msg

thing()  

Indent those, this is fine, or maybe I don't understand the problem.

def thing():  
    ''' Here's the thing...  
          It prints hi  
    '''  
    msg = 'hi'  
    print msg

thing()  

a = 1  

if ( a < 10 ):  
    """  
      Comment 1  
    """  
    a = a + 1  


    '''  attic space, heh  
           Comment 2  
    '''  
    if ( thing() ):  
        pass