[cairo-commit] pycairo ChangeLog, 1.269, 1.270 FAQ, NONE, 1.1 configure.ac, 1.66, 1.67

Steve Chaplin commit at pdx.freedesktop.org
Wed Dec 12 04:14:21 PST 2007


Committed by: stevech1097

Update of /cvs/cairo/pycairo
In directory kemper:/tmp/cvs-serv7550

Modified Files:
	ChangeLog configure.ac 
Added Files:
	FAQ 
Log Message:
'SC'

Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/pycairo/ChangeLog,v
retrieving revision 1.269
retrieving revision 1.270
diff -u -d -r1.269 -r1.270
--- ChangeLog	11 Dec 2007 02:56:48 -0000	1.269
+++ ChangeLog	12 Dec 2007 12:14:18 -0000	1.270
@@ -1,3 +1,13 @@
+2007-12-12  Steven Chaplin  <steve1097 # yahoo.com.au>
+
+	* FAQ: new file
+
+	* configure.ac: Require Python 2.4
+
+	* cairo/pycairo-private.h: Remove macros required for Python < 2.4
+
+	* test/test.py (_test): Remove line checking for Python < 2.4
+
 2007-12-11  Steven Chaplin  <steve1097 # yahoo.com.au>
 
 	* cairo/pycairo-context.c (pycairo_dealloc):

--- NEW FILE: FAQ ---
Pycairo FAQ - Frequently Asked Questions
----------------------------------------

Q Can I subclass pycairo classes?
A
Cairo, the C library, is not an object oriented library, so a Python binding
can never be a truly object oriented interface to cairo.  One way to write the
Python bindings for cairo would be as a single long list of module functions -
this would be the most accurate representation of the underlying C
library. Pycairo (and most other cairo language bindings?) instead chose to
implement the bindings using Context, Surface, Pattern, etc classes.  An
advantage is that the classes organise cairo into groups of similar functions.
A disadvantage is that creates an illusion that cairo is object oriented
library, and people are then tempted to create subclasses to override cairo
methods. When in fact there are no methods to override, just cairo functions
which can't be overridden.

The cairo documentation Appendix A "Creating a language binding for cairo"
section "Memory Management" describes why deriving from a Surface creates
problems and is best avoided.

cairo.Context can be subclassed.
All other pycairo subclasses cannot be subclassed.

Index: configure.ac
===================================================================
RCS file: /cvs/cairo/pycairo/configure.ac,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- configure.ac	6 Apr 2007 08:38:44 -0000	1.66
+++ configure.ac	12 Dec 2007 12:14:19 -0000	1.67
@@ -34,7 +34,7 @@
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL dnl required version (1.4) DON'T REMOVE - used by autogen.sh
 
-AM_PATH_PYTHON(2.3)
+AM_PATH_PYTHON(2.4)
 
 # Checks for libraries ---
 



More information about the cairo-commit mailing list