Commit Graph

28 Commits

Author SHA1 Message Date
Daniele Varrazzo
a2b01cdf42 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.
2014-08-15 02:54:31 +01:00
Daniele Varrazzo
95165cef7d Dropped almost-no-op customized objects repr()
The default repr is enough: it prints <TypeName at 0xADDR> instead of
<TypeName object at 0xADDR>.

The only people being hurt by this change are the ones using doctests:
they deserve it.
2014-08-15 02:54:10 +01:00
Daniele Varrazzo
669e787919 Name the types after the module they are exposed from 2014-08-15 01:47:19 +01:00
Daniele Varrazzo
e14440d96d Dropped GC support for several objects
Non-containers don't need GC. It was half-baked anyway
as the tp_clear was often not set. Dropped tp_traverse too
for these objects as unused.
2013-04-05 01:02:47 +01:00
Daniele Varrazzo
d5316d7eb2 PyType_GenericAlloc is the default allocator: no need to specify 2013-03-20 23:53:20 +00:00
Daniele Varrazzo
5dfba462da Dropped "customized" pg_free functions
The defaut is already to call PyObject_GC_Del.
2013-03-20 01:48:21 +00:00
Daniele Varrazzo
b6d6fbbe8c Use a global object for NULL
Small optimization as NULL is a frequent value to build.
2011-02-17 20:09:52 +00:00
Daniele Varrazzo
3214c23f51 Fixed adaptation in several adapters.
The getquoted methods always return bytes. The str() convert this
representation to string on the fly.
2010-12-31 03:18:27 +01:00
Daniele Varrazzo
56e4c2bd55 Redefining the microprotocol on Py3 as returning bytes. 2010-12-31 03:18:26 +01:00
Daniele Varrazzo
cb6b52945b The library can be compiled with Python 3.
Just compiled! No test run yet and many points to review, marked in the
code.

The patch is largely Martin von Löwis work, simplified after refactoring
in the previous commits and adapted to the new code (as the patch was
originally for Psycopg 2.0.9)
2010-12-21 04:24:36 +00:00
Daniele Varrazzo
4635c2aa4f Import structmember/stringobject headers from python.h.
stringobject is not to be imported with Python 3.
2010-12-21 04:02:13 +00:00
Daniele Varrazzo
9b30147341 Using PyVarObject_HEAD_INIT macro. 2010-12-21 04:02:13 +00:00
Daniele Varrazzo
8dfa9915eb Using Py_TYPE and Py_REFCNT macros. 2010-12-21 04:02:13 +00:00
Daniele Varrazzo
89f70bdb3c Changed Python const RO -> READONLY. 2010-12-12 13:39:32 +00:00
Daniele Varrazzo
6d7916cfe1 Internal imports simplified.
.c files only need to import psycopg.h: it will in turn import
dependencies from Python and libpq and configure.h. psycopg.h should be
the first to be imported, so the basic imports are not required in
the .h's

As a guideline I'm trying to import from the most specific to the most
generic to detect missing imports in the .h's.
2010-12-12 13:39:32 +00:00
Daniele Varrazzo
ed6a4c8b1a Dropped PyArg_ParseTuple() calls in functions taking no arguments. 2010-11-09 03:18:54 +00:00
Daniele Varrazzo
422fede38e Replaced PyObject_CallFunction() with *ObjArgs() where more efficient. 2010-11-09 01:49:22 +00:00
Federico Di Gregorio
611606d532 Changes license to LGPL3 + OpenSSL exception on all source files 2010-02-12 23:34:53 +01:00
James Henstridge
2273b79be9 Use Py_CLEAR() in a few more places, and do INCREF's before setting
struct members rather than afterwards.
2008-07-21 13:41:54 +08:00
James Henstridge
47d2414e32 * psycopg/adapter_asis.c (asis_traverse): add cyclic GC traversal
for AsIs adapters.
2008-07-01 09:57:16 +08:00
James Henstridge
f18881983b * psycopg/typecast_array.c (typecast_array_scan): set an initial
value for quotes to keep gcc happy.

	* psycopg/*.c: add missing static modifier on many functions.
2008-01-13 16:05:59 +00:00
Federico Di Gregorio
e5829292cd Fixed both Python 2.5 and 64 bit problems. 2007-04-10 06:36:18 +00:00
Federico Di Gregorio
6b0b634bae Code cleanup. 2005-10-18 01:29:47 +00:00
Federico Di Gregorio
4805a93569 mingw patch from Daniele Varazzo. 2005-04-10 03:05:39 +00:00
Federico Di Gregorio
22ce01eec7 AsIs str fix by Matt Goodall. 2005-03-03 15:01:45 +00:00
Federico Di Gregorio
c787de5aad Added __conform__ to all adapters (typos excluded.) 2005-03-03 06:39:18 +00:00
Federico Di Gregorio
515d66cc9f Added __conform__ to all adapters. 2005-03-03 06:31:03 +00:00
Federico Di Gregorio
cd672525e1 Adaptation fixes (a lot.) 2005-02-28 15:50:55 +00:00