aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/google/protobuf/text_format.py
diff options
context:
space:
mode:
authorGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-12-23 02:08:05 +0000
committerGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-12-23 02:08:05 +0000
commit46ed74e8d456d7d2a983c6c86e2c347d8a5b4843 (patch)
tree36f35ae5ee48b75cfaa3465fca1adb49fd9c0b26 /python/google/protobuf/text_format.py
parentd0047c43d955174d79a2df623dbb4007965252b5 (diff)
Actually, that last revision can be simpler -- we don't need to parse strings at all, as simply entering 1e1000 as a float literal in Python will be evaluated as infinity.
Diffstat (limited to 'python/google/protobuf/text_format.py')
-rwxr-xr-xpython/google/protobuf/text_format.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py
index 2def19c2..428e8c55 100755
--- a/python/google/protobuf/text_format.py
+++ b/python/google/protobuf/text_format.py
@@ -45,7 +45,7 @@ __all__ = [ 'MessageToString', 'PrintMessage', 'PrintField',
# Infinity and NaN are not explicitly supported by Python pre-2.6, and
# float('inf') does not work on Windows (pre-2.6).
-_INFINITY = float('1e10000')
+_INFINITY = 1e10000 # overflows, thus will actually be infinity.
_NAN = _INFINITY * 0