Skip to content

Commit d5461bd

Browse files
Further simplification.
1 parent 07bb84e commit d5461bd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

samples/type_handlers.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,13 @@ def building_out_converter(obj):
5353

5454
def input_type_handler(cursor, value, num_elements):
5555
if isinstance(value, Building):
56-
return cursor.var(oracledb.OBJECT, arraysize=num_elements,
57-
inconverter=building_in_converter, typename=obj_type.name)
56+
return cursor.var(obj_type, arraysize=num_elements,
57+
inconverter=building_in_converter)
5858

5959
def output_type_handler(cursor, name, default_type, size, precision, scale):
6060
if default_type == oracledb.OBJECT:
61-
return cursor.var(oracledb.OBJECT, arraysize=cursor.arraysize,
62-
outconverter=building_out_converter,
63-
typename=obj_type.name)
61+
return cursor.var(obj_type, arraysize=cursor.arraysize,
62+
outconverter=building_out_converter)
6463

6564
buildings = [
6665
Building(1, "The First Building", 5, datetime.date(2007, 5, 18)),

0 commit comments

Comments
 (0)