IronPython and collections access

Discussion in 'Python' started by Hoang Do, Aug 18, 2004.

  1. Hoang Do

    Hoang Do Guest

    I have been able to access global functions and objects with IronPython.
    However the following attempt to access collections bombs:

    import System
    x = System.Collections.BitArray(4)
    x[0]

    The error message is:
    'System.Collections.BitArray' object has no attribute '__getitem__'. This
    is the same error with any classes derived from CollectionsBase.

    Has anyone been able to access a collection successfully?

    Hoang Do
    http://jotsite.com
    Hoang Do, Aug 18, 2004
    #1
    1. Advertising

  2. In data Wed, 18 Aug 2004 20:17:13 GMT, Hoang Do ha scritto:

    > import System
    > x = System.Collections.BitArray(4)
    > x[0]
    >
    > The error message is:
    > 'System.Collections.BitArray' object has no attribute '__getitem__'. This
    > is the same error with any classes derived from CollectionsBase.


    try x.Get(yourindex)

    --
    Lawrence (l dot oluyede at virgilio dot it)
    "If the implementation is hard to explain, it's a bad idea."
    from The Zen of Python by Tim Peters
    Lawrence Oluyede, Aug 18, 2004
    #2
    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. Doug Poland
    Replies:
    9
    Views:
    708
    VisionSet
    Sep 27, 2003
  2. JZ
    Replies:
    0
    Views:
    442
  3. John Salerno

    Python for .NET and IronPython

    John Salerno, Nov 2, 2005, in forum: Python
    Replies:
    8
    Views:
    508
    Luis M. Gonzalez
    Nov 3, 2005
  4. Carl Johan Rehn
    Replies:
    3
    Views:
    1,607
    Ian Bicking
    Feb 20, 2006
  5. mutex
    Replies:
    0
    Views:
    196
    mutex
    Jul 27, 2003
Loading...

Share This Page