This is not a bug. Rather it is a consequence of the syntax require by 
python. To quote from the python 
documentation<http://docs.python.org/release/2.5.1/ref/indentation.html>
:

Leading whitespace (spaces and tabs) at the beginning of a logical line is 
used to compute the indentation level of the line, which in turn is used to 
determine the grouping of statements. 
The reason why you are getting an error here is that in python code, 
including comment, in for-loops must be indented. The rationale for this is 
that it makes the code easier to read. I tend to agree because I used to 
indent my code before I started using python. I even indent in tex files:)

Andrew


On Sunday, 3 November 2013 11:29:20 UTC+1, projetmbc wrote:
>
> Hello.
>
> I think that is not good to have an error with the following code.
>
> ----------------------------------------
> for i in range(10):
> # Here is a basic comment...
>     print i, "-->", i**2
> ----------------------------------------
>
> The error due to the comment is the following one.
>
> Error in lines 1-1 Traceback (most recent call last): File 
> "/mnt/home/pjXx5pJx/.sagemathcloud/sage_server.py", line 633, in execute 
> exec compile(block+'\n', '', 'single') in namespace, locals File 
> "<string>", line 1 for i in range(Integer(10)): ^ SyntaxError: unexpected 
> EOF while parsing
>
>
> Just add a space before # and everything is ok... Too weird...
> This should be fixed.
>
> Best regards.
> C.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to