Fixed typecast definition order

Didn't notice that the order matter: the last typecaster registered is
the effective one so let STRING win over UNICODE and BYTES.
This commit is contained in:
Daniele Varrazzo 2019-01-18 15:09:20 +00:00
parent f713dc9fc1
commit fd31a7d41b

View File

@ -39,8 +39,8 @@ static typecastObject_initlist typecast_builtins[] = {
{"FLOAT", typecast_FLOAT_types, typecast_FLOAT_cast, NULL}, {"FLOAT", typecast_FLOAT_types, typecast_FLOAT_cast, NULL},
{"DECIMAL", typecast_DECIMAL_types, typecast_DECIMAL_cast, NULL}, {"DECIMAL", typecast_DECIMAL_types, typecast_DECIMAL_cast, NULL},
{"UNICODE", typecast_STRING_types, typecast_UNICODE_cast, NULL}, {"UNICODE", typecast_STRING_types, typecast_UNICODE_cast, NULL},
{"STRING", typecast_STRING_types, typecast_STRING_cast, NULL},
{"BYTES", typecast_STRING_types, typecast_BYTES_cast, NULL}, {"BYTES", typecast_STRING_types, typecast_BYTES_cast, NULL},
{"STRING", typecast_STRING_types, typecast_STRING_cast, NULL},
{"BOOLEAN", typecast_BOOLEAN_types, typecast_BOOLEAN_cast, NULL}, {"BOOLEAN", typecast_BOOLEAN_types, typecast_BOOLEAN_cast, NULL},
{"DATETIME", typecast_DATETIME_types, typecast_DATETIME_cast, NULL}, {"DATETIME", typecast_DATETIME_types, typecast_DATETIME_cast, NULL},
{"DATETIMETZ", typecast_DATETIMETZ_types, typecast_DATETIMETZ_cast, NULL}, {"DATETIMETZ", typecast_DATETIMETZ_types, typecast_DATETIMETZ_cast, NULL},