adjacent differences with a list comprehension
mwh at python.net
Wed Mar 26 13:38:44 CET 2003
"Greg Ewing (using news.cis.dfn.de)" <me at privacy.net> writes:
> Alex Martelli wrote:
> > I have no idea how or why operator.sub can be faster
> > than int.__sub__ in this case...!
> Perhaps because int.__sub__ returns a wrapper object
> around the underlying function, whereas operator.sub
> provides more direct access to it? Not sure about
Yeah, that's what I was thinking too. ceval.c knows how to call
PyCFunction objects directly, but I guess __int__.__sub__ goes through
the whole tp_call thing. The latter may also do more type checking;
not sure about that.
Do I do everything in C++ and teach a course in advanced swearing?
-- David Beazley at IPC8, on choosing a language for teaching
More information about the Python-list