#1004 Code formatter doesn't work with 1E-3

1.4.8
closed-fixed
Editor (491)
5
2014-07-31
2009-11-06
No

When formatting the expression "1E-3" the result is "1E - 3", which results in "SyntaxError: invalid token".

For "1e-3" the formatting works perfectly, resulting in the same expression "1e-3".

Also, the syntax highlight doesn't work for expression "1E-3".

Here an example of code where a realized it is happening:

# -*- coding: cp1252 -*-
from unum import Unum
unit = Unum.unit

M = unit('m' , 0 , 'meter')
CM = unit('cm' , .01 * M , 'centimeter')
MM = unit('mm' , .001 * M , 'millimeter')
KM = unit('km' , 1000. * M , 'kilometer')

KG = unit('kg' , 0 , 'kilogram')
G = unit('g' , .001 * KG , 'gram')
MG = unit('mg' , .000001 * KG , 'miligram')
MICROGRAM = unit('microgram' , .000000001 * KG , 'microgram')

L = unit('L' , 1E-3 * M ** 3 , 'liter')

S = unit('s' , 0 , 'second')

U_MINUTE = unit('minute', 60.0 * S, 'minute')
U_HOUR = unit('hour' , 3600.0 * S, 'hour')
U_DAY = unit('day' , 86400.0 * S, 'day')
U_WEEK = unit('week' , 604800.0 * S, 'week')
U_MONTH = unit('month' , 2629800.0 * S, 'month')
U_YEAR = unit('year' , 31557600.0 * S, 'year')

MOL = unit('MOL' , 0 , 'mol')

Discussion

  • Fabio Zadrozny

    Fabio Zadrozny - 2009-11-10

    Done for 1.5.1

    Git
    %h 806343e
    %ct 1257815473

     
  • Fabio Zadrozny

    Fabio Zadrozny - 2009-11-10
    • status: open --> closed-fixed