From b3ce0525252920bee7e1e5cb51c26ab5ef58590b Mon Sep 17 00:00:00 2001 From: adustman Date: Mon, 27 Feb 2006 23:10:38 +0000 Subject: [PATCH] Python Sets (from sets module) as parameters work, but *only* Set and not ImmutableSet. Still trying to get it to work on BaseSet so any subclasses will work. --- MySQLdb/MySQLdb/converters.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MySQLdb/MySQLdb/converters.py b/MySQLdb/MySQLdb/converters.py index 307a10c..d03c3c2 100644 --- a/MySQLdb/MySQLdb/converters.py +++ b/MySQLdb/MySQLdb/converters.py @@ -34,7 +34,7 @@ MySQL.connect(). from _mysql import string_literal, escape_sequence, escape_dict, escape, NULL from constants import FIELD_TYPE, FLAG -from sets import BaseSet +from sets import BaseSet, Set from times import * import types import array @@ -42,8 +42,7 @@ import array def Bool2Str(s, d): return str(int(s)) def Str2Set(s): - values = s.split(',') - return Set(*values) + return Set(s.split(',')) def Set2Str(s, d): return string_literal(','.join(s), d) @@ -127,7 +126,7 @@ conversions = { types.BooleanType: Bool2Str, DateTimeType: DateTime2literal, DateTimeDeltaType: DateTimeDelta2literal, - BaseSet: Set2Str, + Set: Set2Str, FIELD_TYPE.TINY: int, FIELD_TYPE.SHORT: int, FIELD_TYPE.LONG: long,