optimization question
Michael Hudson
mwh at python.net
Mon Aug 12 10:42:15 EDT 2002
Andrew Koenig <ark at research.att.com> writes:
> I'd like to take a step back for a moment. I originally asked a
> simple question:
Which did get answered in amongst all the noise, yes?
> If I write an expression of the form s[i:j] == x, can I count on the
> implementation optimizing it by avoiding a copy of s[i:j], so that I
> can be assured of not having to think about finding more efficient
> alternatives?
If you have a question that contains the phrase "can I count on the
implementation optimizing ..." then the answer is almost certainly
"no".
Cheers,
M.
--
... so the notion that it is meaningful to pass pointers to memory
objects into which any random function may write random values
without having a clue where they point, has _not_ been debunked as
the sheer idiocy it really is. -- Erik Naggum, comp.lang.lisp
More information about the Python-list
mailing list