Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #32505 > unrolled thread

Re: Negative array indicies and slice()

Started byEthan Furman <ethan@stoneleaf.us>
First post2012-10-30 14:21 -0700
Last post2012-10-30 14:21 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Negative array indicies and slice() Ethan Furman <ethan@stoneleaf.us> - 2012-10-30 14:21 -0700

#32505 — Re: Negative array indicies and slice()

FromEthan Furman <ethan@stoneleaf.us>
Date2012-10-30 14:21 -0700
SubjectRe: Negative array indicies and slice()
Message-ID<mailman.3104.1351632673.27098.python-list@python.org>
Andrew Robinson wrote:
> I can see that the slice() function can pass in arbitrary arguments.
> I'm not sure for lists, which is what the range is applied to, why an 
> argument like "a" would be part of a slice.

Well, in my dbf.py Record class you can use the names of fields as the slice arguments, instead of 
having to remember the offsets.  record['full_name':'zip4'] returns a tuple (or a list, I don't 
remember) of about 13 fields -- this is especially useful as that block of fields might not be in 
the same place in each table.

~Ethan~

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web