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

Markus Schaber m.schaber at 3s-software.com
Mon Jun 20 08:40:39 CEST 2011


Hi, Doug,

> Von: Doug Blank

[> ] 
> On Sun, Jun 19, 2011 at 3:06 AM, Abubakar <abubakarm at gmail.com> wrote:
> > try reading the following, maybe that'll explain:
> > http://stackoverflow.com/questions/44834/can-someone-explain-all-in-py
> > thon
> > ..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.

Just as in Python itsself, you cannot "add" values to __all__, you have to set the full list of all wanted members.

Mit freundlichen Grüßen

Markus Schaber

___________________________
We software Automation.

3S-Smart Software Solutions GmbH
Markus Schaber | Entwicklung
Memminger Str. 151 | 87439 Kempten | Tel. +49-831-54031-0 | Fax +49-831-54031-50

Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com 
CoDeSys Internet-Forum: http://forum.3s-software.com

Geschäftsführer: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Handelsregister: Kempten HRB 6186 | USt-IDNr.: DE 167014915


More information about the Ironpython-users mailing list