Changeset: 348035724a98 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=348035724a98
Modified Files:
        clients/python/monetdb/sql/monetize.py
Branch: default
Log Message:

reverted auto convertion of types. better to raise an error than to
implicitly convert


diffs (27 lines):

diff --git a/clients/python/monetdb/sql/monetize.py 
b/clients/python/monetdb/sql/monetize.py
--- a/clients/python/monetdb/sql/monetize.py
+++ b/clients/python/monetdb/sql/monetize.py
@@ -16,7 +16,9 @@
 # All Rights Reserved.
 
 """
-functions for converting python objects to monetdb SQL format
+functions for converting python objects to monetdb SQL format. If you want
+to add support for a specific type you should add a function as a value to
+the mapping dict and the datatype as key.
 """
 
 import datetime
@@ -77,9 +79,4 @@ def convert(data):
     try:
         return mapping[type(data)](data)
     except KeyError:
-        if hasattr(data, '__unicode__'):
-            return unicode(data).encode('utf-8')
-        elif hasattr(data, '__str__'):
-            return str(data)
-        else:
-            raise ProgrammingError("type %s not supported as value" % 
type(data))
\ No newline at end of file
+        raise ProgrammingError("type %s not supported as value" % type(data))
\ No newline at end of file
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to