diff utils/seriestables/series.py @ 221:02d9c1279dd8

Encore quelques typechecks à SeriesTables.
author fsavard
date Thu, 11 Mar 2010 11:08:42 -0500
parents e172ef73cdc5
children 0515a8901c6a
line wrap: on
line diff
--- a/utils/seriestables/series.py	Thu Mar 11 10:48:54 2010 -0500
+++ b/utils/seriestables/series.py	Thu Mar 11 11:08:42 2010 -0500
@@ -39,6 +39,8 @@
     int_constructor = "tables.Int64Col"
     if int_width == 32:
         int_constructor = "tables.Int32Col"
+    elif not int_width in (32, 64):
+        raise "int_width must be left unspecified, or should equal 32 or 64"
 
     toexec = ""
 
@@ -89,6 +91,8 @@
     float_constructor = "tables.Float32Col"
     if float_width == 64:
         float_constructor = "tables.Float64Col"
+    elif not float_width in (32, 64):
+        raise "float_width must be left unspecified, or should equal 32 or 64"
 
     for n in float_names:
         toexec += "\t" + n + " = " + float_constructor + "(pos=" + str(pos) + ")\n"
@@ -366,7 +370,8 @@
             self._buffer = []
 
         # The >= case should never happen, except if lists
-        # were appended, which should be a red flag.
+        # were appended by accessing _buffer externally (when it's
+        # intended to be private), which should be a red flag.
         assert len(self._buffer) < self.reduce_every
 
 # Outside of class to fix an issue with exec in Python 2.6.