[Ironpython-users] How can IronPython access a public static value defined in C#?

Douglas S. Blank dblank at cs.brynmawr.edu
Sun Jun 19 14:56:26 CEST 2011


> try reading the following, maybe that'll explain:
> http://stackoverflow.com/questions/44834/can-someone-explain-all-in-python
>
> ..ab

Well, my question was about how to do that in C#.

I can indeed do this:

public static class Myro {
  public readonly static List __all__ = new List() {"robot"};
  public static Robot robot {
     get {}
     set {}
  }
}

but then "robot" is the *only* item imported. I would like add robot to
the list of items imported.

-Doug

> On Sun, Jun 19, 2011 at 7:41 AM, Doug Blank <doug.blank at gmail.com> wrote:
>
>> On Sat, Jun 18, 2011 at 1:56 PM, Dino Viehland <dinov at microsoft.com>
>> wrote:
>>
>> [snip]
>>
>> >> Is there something I can do to make white accessible with "from ...
>> import
>> >> *"?
>> >
>> > If you mark the field as readonly we'll let you import it using import
>> *.
>> Without
>> > it being read-only we don't put it in Graphics.__all__ and therefore
>> it
>> doesn't
>> > get imported.
>> >
>>
>> Yes, thanks, you answered that, but missed the end of my mail:
>>
>> I ask follow-up questions:
>>
>> Yes, that did it. Is there a way to make public static properties
>> visible?
>>
>>  public static int MyValue {
>>     get {}
>>     set {}
>>  };
>>
>> doesn't seem to appear in "from ... import *".
>>
>> Oh, and what is .all? Can we add things to that in C#?
>>
>> -Doug
>> _______________________________________________
>> Ironpython-users mailing list
>> Ironpython-users at python.org
>> http://mail.python.org/mailman/listinfo/ironpython-users
>>
> _______________________________________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> http://mail.python.org/mailman/listinfo/ironpython-users
>



More information about the Ironpython-users mailing list