Changeset 248
- Timestamp:
- 03/22/07 12:13:32 (6 years ago)
- File:
-
- 1 edited
-
pyyaml/trunk/lib/yaml/representer.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
pyyaml/trunk/lib/yaml/representer.py
r235 r248 198 198 value = u'-.inf' 199 199 else: 200 value = unicode(repr(data)) 200 value = unicode(repr(data)).lower() 201 # Note that in some cases `repr(data)` represents a float number 202 # without the decimal parts. For instance: 203 # >>> repr(1e17) 204 # '1e17' 205 # Unfortunately, this is not a valid float representation according 206 # to the definition of the `!!float` tag. We fix this by adding 207 # '.0' before the 'e' symbol. 208 if u'.' not in value and u'e' in value: 209 value = value.replace(u'e', u'.0e', 1) 201 210 return self.represent_scalar(u'tag:yaml.org,2002:float', value) 202 211
Note: See TracChangeset
for help on using the changeset viewer.
