[Checkins] SVN: z3c.form/trunk/ don't fail due to change in floating point representation in Python 2.7

David Glick davidglick at onenw.org
Sat Apr 30 01:44:21 EDT 2011


Log message for revision 121478:
  don't fail due to change in floating point representation in Python 2.7

Changed:
  U   z3c.form/trunk/CHANGES.txt
  U   z3c.form/trunk/src/z3c/form/converter.txt

-=-
Modified: z3c.form/trunk/CHANGES.txt
===================================================================
--- z3c.form/trunk/CHANGES.txt	2011-04-30 04:43:34 UTC (rev 121477)
+++ z3c.form/trunk/CHANGES.txt	2011-04-30 05:44:20 UTC (rev 121478)
@@ -5,6 +5,9 @@
 2.4.3 (unreleased)
 ------------------
 
+- Fixed test failure due to change in floating point representation in Python
+  2.7.
+
 - Ensure at least min_length widgets are rendered for a MultiWidget in input
   mode.
 

Modified: z3c.form/trunk/src/z3c/form/converter.txt
===================================================================
--- z3c.form/trunk/src/z3c/form/converter.txt	2011-04-30 04:43:34 UTC (rev 121477)
+++ z3c.form/trunk/src/z3c/form/converter.txt	2011-04-30 05:44:20 UTC (rev 121478)
@@ -196,8 +196,10 @@
   >>> floatdc.toWidgetValue(10239.43)
   u'10,239.43'
 
-  >>> floatdc.toFieldValue(u'7.43')
-  7.4299999999999997
+  >>> floatdc.toFieldValue(u'7.43') == 7.43
+  True
+  >>> type(floatdc.toFieldValue(u'7.43'))
+  <type 'float'>
   >>> floatdc.toFieldValue(u'10,239.43')
   10239.43
 



More information about the checkins mailing list