Re: Negative array indicies and slice()

Discussion in 'Python' started by Ethan Furman, Oct 30, 2012.

  1. Ethan Furman

    Ethan Furman Guest

    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~
     
    Ethan Furman, Oct 30, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    72
    Views:
    860
    88888 Dihedral
    Nov 2, 2012
  2. Andrew Robinson

    Re: Negative array indicies and slice()

    Andrew Robinson, Oct 29, 2012, in forum: Python
    Replies:
    0
    Views:
    137
    Andrew Robinson
    Oct 29, 2012
  3. Mark Lawrence

    Re: Negative array indicies and slice()

    Mark Lawrence, Oct 29, 2012, in forum: Python
    Replies:
    0
    Views:
    169
    Mark Lawrence
    Oct 29, 2012
  4. Dennis Lee Bieber

    Re: Negative array indicies and slice()

    Dennis Lee Bieber, Oct 31, 2012, in forum: Python
    Replies:
    0
    Views:
    165
    Dennis Lee Bieber
    Oct 31, 2012
  5. Ian Kelly
    Replies:
    0
    Views:
    211
    Ian Kelly
    Oct 31, 2012
Loading...

Share This Page