#4454: bug in preparser
---------------------------+------------------------------------------------
 Reporter:  ggrafendorfer  |        Owner:  cwitty  
     Type:  defect         |       Status:  new     
 Priority:  major          |    Milestone:  sage-3.2
Component:  misc           |   Resolution:          
 Keywords:                 |  
---------------------------+------------------------------------------------
Changes (by mabshoff):

  * priority:  minor => major

Old description:

> sage 3.1.4 on a 32-bit core duo
>
> consider a file 'time.sage' with the following content:
>
> def func(time = 5):
>     time = RDF(time)
>     return time
>
> loading this file then yields following error:
>
> sage: load time.sage
> ------------------------------------------------------------
>    File
> "/home/georg/.sage/temp/HILBERT/4119/_home_georg_Daten_Sync_Software_Sage_Experimente_time_time_sage_0.py",
> line 7
>      __time__=misc.cputime(); __wall__=misc.walltime();  = RDF(time);
> print     "Time: CPU %.2f s, Wall: %.2f s"%(misc.cputime(__time__),
> misc.walltime(__wall__))
>                                                          ^
> SyntaxError: invalid syntax
>
> WARNING: Failure executing file:
> </home/georg/.sage/temp/HILBERT/4119/_home_georg_Daten_Sync_Software_Sage_Experimente_time_time_sage_0.py>
>

> If one quits the space between 'time' and '=' in the second line of
> 'time.sage' it works as expected.
> Defining this function directly on the sage prompt also works as
> expected.

New description:

 sage 3.1.4 on a 32-bit core duo

 consider a file 'time.sage' with the following content:
 {{{
 def func(time = 5):
     time = RDF(time)
     return time
 }}}
 loading this file then yields following error:
 {{{
 sage: load time.sage
 ------------------------------------------------------------
    File
 
"/home/georg/.sage/temp/HILBERT/4119/_home_georg_Daten_Sync_Software_Sage_Experimente_time_time_sage_0.py",
 line 7
      __time__=misc.cputime(); __wall__=misc.walltime();  = RDF(time);
 print     "Time: CPU %.2f s, Wall: %.2f s"%(misc.cputime(__time__),
 misc.walltime(__wall__))
                                                          ^
 SyntaxError: invalid syntax

 WARNING: Failure executing file:
 
</home/georg/.sage/temp/HILBERT/4119/_home_georg_Daten_Sync_Software_Sage_Experimente_time_time_sage_0.py>
 }}}

 If one quits the space between 'time' and '=' in the second line of
 'time.sage' it works as expected.
 Defining this function directly on the sage prompt also works as expected.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4454#comment:2>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to