Skip to content

Commit a2b01cd

Browse files
committed
Dropped simple type wrapper functions
These functions don't need to exist: exposing the type in the module is enough. It is actually better as one may use isinstance and such.
1 parent 1b322a9 commit a2b01cd

17 files changed

+8
-175
lines changed

psycopg/adapter_asis.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,3 @@ PyTypeObject asisType = {
194194
0, /*tp_alloc*/
195195
asis_new, /*tp_new*/
196196
};
197-
198-
199-
/** module-level functions **/
200-
201-
PyObject *
202-
psyco_AsIs(PyObject *module, PyObject *args)
203-
{
204-
PyObject *obj;
205-
206-
if (!PyArg_ParseTuple(args, "O", &obj))
207-
return NULL;
208-
209-
return PyObject_CallFunctionObjArgs((PyObject *)&asisType, obj, NULL);
210-
}

psycopg/adapter_asis.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ typedef struct {
4040

4141
} asisObject;
4242

43-
/* functions exported to psycopgmodule.c */
44-
45-
HIDDEN PyObject *psyco_AsIs(PyObject *module, PyObject *args);
46-
#define psyco_AsIs_doc \
47-
"AsIs(obj) -> new AsIs wrapper object"
48-
4943
#ifdef __cplusplus
5044
}
5145
#endif

psycopg/adapter_binary.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -299,17 +299,3 @@ PyTypeObject binaryType = {
299299
0, /*tp_alloc*/
300300
binary_new, /*tp_new*/
301301
};
302-
303-
304-
/** module-level functions **/
305-
306-
PyObject *
307-
psyco_Binary(PyObject *module, PyObject *args)
308-
{
309-
PyObject *str;
310-
311-
if (!PyArg_ParseTuple(args, "O", &str))
312-
return NULL;
313-
314-
return PyObject_CallFunctionObjArgs((PyObject *)&binaryType, str, NULL);
315-
}

psycopg/adapter_binary.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ typedef struct {
4040
PyObject *conn;
4141
} binaryObject;
4242

43-
/* functions exported to psycopgmodule.c */
44-
45-
HIDDEN PyObject *psyco_Binary(PyObject *module, PyObject *args);
46-
#define psyco_Binary_doc \
47-
"Binary(buffer) -> new binary object\n\n" \
48-
"Build an object capable to hold a binary string value."
49-
5043
#ifdef __cplusplus
5144
}
5245
#endif

psycopg/adapter_list.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,3 @@ PyTypeObject listType = {
260260
0, /*tp_alloc*/
261261
list_new, /*tp_new*/
262262
};
263-
264-
265-
/** module-level functions **/
266-
267-
PyObject *
268-
psyco_List(PyObject *module, PyObject *args)
269-
{
270-
PyObject *obj;
271-
272-
if (!PyArg_ParseTuple(args, "O", &obj))
273-
return NULL;
274-
275-
return PyObject_CallFunctionObjArgs((PyObject *)&listType, obj, NULL);
276-
}

psycopg/adapter_list.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ typedef struct {
3939
PyObject *connection;
4040
} listObject;
4141

42-
HIDDEN PyObject *psyco_List(PyObject *module, PyObject *args);
43-
#define psyco_List_doc \
44-
"List(list, enc) -> new quoted list"
45-
4642
#ifdef __cplusplus
4743
}
4844
#endif

psycopg/adapter_pboolean.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,3 @@ PyTypeObject pbooleanType = {
191191
0, /*tp_alloc*/
192192
pboolean_new, /*tp_new*/
193193
};
194-
195-
196-
/** module-level functions **/
197-
198-
PyObject *
199-
psyco_Boolean(PyObject *module, PyObject *args)
200-
{
201-
PyObject *obj;
202-
203-
if (!PyArg_ParseTuple(args, "O", &obj))
204-
return NULL;
205-
206-
return PyObject_CallFunctionObjArgs((PyObject *)&pbooleanType, obj, NULL);
207-
}

psycopg/adapter_pboolean.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ typedef struct {
4040

4141
} pbooleanObject;
4242

43-
/* functions exported to psycopgmodule.c */
44-
45-
HIDDEN PyObject *psyco_Boolean(PyObject *module, PyObject *args);
46-
#define psyco_Boolean_doc \
47-
"Boolean(obj) -> new boolean value"
48-
4943
#ifdef __cplusplus
5044
}
5145
#endif

psycopg/adapter_pdecimal.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -247,17 +247,3 @@ PyTypeObject pdecimalType = {
247247
0, /*tp_alloc*/
248248
pdecimal_new, /*tp_new*/
249249
};
250-
251-
252-
/** module-level functions **/
253-
254-
PyObject *
255-
psyco_Decimal(PyObject *module, PyObject *args)
256-
{
257-
PyObject *obj;
258-
259-
if (!PyArg_ParseTuple(args, "O", &obj))
260-
return NULL;
261-
262-
return PyObject_CallFunctionObjArgs((PyObject *)&pdecimalType, obj, NULL);
263-
}

psycopg/adapter_pdecimal.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ typedef struct {
4040

4141
} pdecimalObject;
4242

43-
/* functions exported to psycopgmodule.c */
44-
45-
HIDDEN PyObject *psyco_Decimal(PyObject *module, PyObject *args);
46-
#define psyco_Decimal_doc \
47-
"Decimal(obj) -> new decimal.Decimal value"
48-
4943
#ifdef __cplusplus
5044
}
5145
#endif

0 commit comments

Comments
 (0)