descriptors for container items

Discussion in 'Python' started by Brock Filer, Sep 4, 2005.

  1. Brock Filer

    Brock Filer Guest


    > > If I do that, the attributes (that was a stupid name for me to

    > choose)
    > > and children would have to not share any names with each other,

    >
    > Since multiple objects can indeed have duplicate attribute names, and
    > such
    > duplication is rampant in Python, I am not sure what you mean.


    felons['@class'] = 'capital'
    felons['class'].do_something()
    felons.class -> SyntaxError

    I thought I had my previous example down to:

    countries/'us'/'Colorado'/'Denver'['@population']

    , but of course that tries to subscript a string with a string; which
    might be an interesting idiom for substring searching, as long as it
    never returned -1.
    Brock Filer, Sep 4, 2005
    #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. Vivi Orunitia
    Replies:
    11
    Views:
    4,469
    Martijn Lievaart
    Feb 4, 2004
  2. Maitre Bart
    Replies:
    2
    Views:
    520
    Maitre Bart
    Feb 11, 2004
  3. Steven T. Hatton
    Replies:
    4
    Views:
    3,894
    Rob Williscroft
    Dec 5, 2004
  4. Brock Filer

    descriptors for container items

    Brock Filer, Sep 2, 2005, in forum: Python
    Replies:
    0
    Views:
    282
    Brock Filer
    Sep 2, 2005
  5. Brock Filer

    descriptors for container items

    Brock Filer, Sep 3, 2005, in forum: Python
    Replies:
    0
    Views:
    265
    Brock Filer
    Sep 3, 2005
Loading...

Share This Page