Argh!! Can't wrap my head around this Python stuff!

nospam.nospam.Gisle Vanem gisle.vanem at gmail.com
Sat Nov 25 18:04:00 EST 2017


Greg Tibbet wrote:

> ellipse() uses the method  self.draw.draw_ellipse()   Okay, fine...
> but WHERE is draw_ellipse defined??  What magic is happening there?
> I've searched the entire PIL directory tree, and the ONLY two places
> draw_ellipse is mentioned are right there in the ellipse() function...
> WHAT am I missing??

The C sources. Not all of PIL is ritten in Python.

draw_ellipse() is a thin wrapper for ImagingDrawEllips(). See PIL/_imaging.c:
   https://github.com/python-pillow/Pillow/_imaging.c

Which again is in libimage/Draw.c:
   https://github.com/python-pillow/Pillow/blob/13d84993717cffd64a2e1d7e3e6edb1
85973d559/libImaging/Draw.c

calling ellipse().

--
--gv




More information about the Python-list mailing list