[IronPython] dir returning protected members

Dino Viehland dinov at microsoft.com
Sat Mar 7 21:47:49 CET 2009


In the 2.6 branch there is.  After importing clr there's an Overloads property on built-in functions (that's been there for a while).  In 2.6 off of the overloads object there is a Targets property which includes all of the CLR MethodBase objects.  You can check the IsFamily, IsFamilyOrAssembly, or IsFamilyAndAssembly properties.  IsFamily is protected, IsFamilyOrAssembly is C#'s protected internal - basically protected to you, IsFamilyAndAssembly is basically an internal method to you (I'm not sure what languages expose this, C# doesn't).

> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-
> bounces at lists.ironpython.com] On Behalf Of Kamil Dworakowski
> Sent: Saturday, March 07, 2009 12:35 PM
> To: users at lists.ironpython.com
> Subject: Re: [IronPython] dir returning protected members
> 
> Is there a way to check if it is a protected member or not?
> 
> On Mar 7, 7:49 pm, Dino Viehland <di... at microsoft.com> wrote:
> > This is the correct behavior.  We expose protected members as normal
> members that throw when the instance isn't a subclass defined in
> Python.  But they need to exist on the base class so that you can do
> things like super calls to them.
> >
> > > -----Original Message-----
> > > From: users-boun... at lists.ironpython.com [mailto:users-
> > > boun... at lists.ironpython.com] On Behalf Of Kamil Dworakowski
> > > Sent: Friday, March 06, 2009 3:05 AM
> > > To: us... at lists.ironpython.com
> > > Subject: [IronPython] dir returning protected members
> >
> > > For my purpose this is bad that dir returns protected members, but
> I
> > > don't know if it is a bug. Is it a bug?
> > > _______________________________________________
> > > Users mailing list
> > > Us... at lists.ironpython.com
> > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
> >
> > _______________________________________________
> > Users mailing list
> >
> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user
> s-ironpython.com
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list