[Qgis-developer] QgsPoint as a python list

Martin Dobias wonder.sk at gmail.com
Tue Jun 3 10:42:03 EDT 2008


On Tue, Jun 3, 2008 at 2:54 PM, Stefanie Tellex <stefie10 at media.mit.edu> wrote:
> This patch (against r8576) extends the QgsPoint python interface so it can
> act like a  two element immutable python list.  This makes idioms the
> following possible:
>
> x, y = point
>
> I also write a lot of code that assumes points are tuples, and with this
> patch I can pass QgsPoints to those methods without any conversion
> code.

This is quite useful patch, I've applied it as r8582. I've omitted the
part with __setitem__ because using p[0] = 5 to set X coordinate is
rather cryptic construction.

Thanks,
Martin


More information about the Qgis-developer mailing list