Correction to type adaption example, making it more transparent

This commit is contained in:
Asmund Tokheim 2014-11-02 14:15:51 +01:00 committed by Daniele Varrazzo
parent e3c6b46416
commit 141e922d80

View File

@ -145,7 +145,9 @@ geometric type:
... self.y = y
>>> def adapt_point(point):
... return AsIs("'(%s, %s)'" % (adapt(point.x), adapt(point.y)))
... x = adapt(point.x).getquoted()
... y = adapt(point.y).getquoted()
... return AsIs("'(%s, %s)'" % (x, y))
>>> register_adapter(Point, adapt_point)