Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > IronPython and collections access

Reply
Thread Tools

IronPython and collections access

 
 
Hoang Do
Guest
Posts: n/a
 
      08-18-2004
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



 
Reply With Quote
 
 
 
 
Lawrence Oluyede
Guest
Posts: n/a
 
      08-18-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between CPython, Python for .NET and IronPython? Carl Johan Rehn Python 3 02-20-2006 10:47 PM
Python for .NET and IronPython John Salerno Python 8 11-03-2005 01:03 PM
IronPython, Boo and ASP.NET (web service) JZ Python 0 01-19-2005 09:33 AM
Sorting collections based on nested collections Doug Poland Java 9 09-27-2003 10:46 PM
InnerProperty Persistance for Collections containing other Collections mutex ASP .Net Building Controls 0 07-27-2003 02:45 PM



Advertisments