a possibly foolish question about slices

Michael Hudson mwh at python.net
Mon Jun 17 05:36:09 EDT 2002


garth at deadlybloodyserious.com (Garth T Kidd) writes:

> > x[p:][:n]
> 
> Does the parser take the appropriate short-cut, here,

No.  Wouldn't be the parser anyway, would it?

> or do we end up with a temporary list?

It's very easy to answer questions about whether Python performs this
sort of optimization: it doesn't.

Cheers,
M.

-- 
  I also feel it essential to note, [...], that Description Logics,
  non-Monotonic Logics, Default Logics and Circumscription Logics 
  can all collectively go suck a cow. Thank you.
              -- http://advogato.org/person/Johnath/diary.html?start=4



More information about the Python-list mailing list