[Ironpython-users] [PythonHidden] not working?

rabidgremlin rabidgremlin at gmail.com
Fri Oct 10 03:40:25 CEST 2014


ahhh,

Yep adding [PythonType] to my class made it work.

Thanks

Jonathan

On Fri, Oct 10, 2014 at 3:56 AM, Jeff Hardy <jdhardy at gmail.com> wrote:

> On Mon, Oct 6, 2014 at 12:57 AM, rabidgremlin <rabidgremlin at gmail.com>
> wrote:
> > Hi there,
> >
> > I'm using IronPython to add scripting to my app. I have some classes with
> > methods that I don't wish to expose to the IronPython scripting engine.
> >
> > Doing some googling it looks like I should be able to add [PythonHidden]
> to
> > my class methods to achieve this, however it doesn't appear to work.
> >
> > eg I have a Layer class with the following method
> >
> > [PythonHidden]
> > public Canvas GetLayerCanvas()
> > {
> >    return layerCanvas;
> > }
> >
> > In my Python script I am still able to call this method and a dir()
> command
> > on a Layer object results in:
> >
> > ['AddElement', 'Delete', 'GetElements', 'GetLayerCanvas', 'GetName',
> > 'MoveBottom', 'MoveDown', 'MoveElementBottom', 'MoveElementDown',
> > 'MoveElementTop', 'MoveElementUp', 'MoveTop', 'MoveUp', 'RemoveElement',
> > 'SetName', '__class__', '__delattr__', '__doc__', '__format__',
> > '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__',
> > '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__',
> > '__subclasshook__']
> >
> > Any ideas?
>
> [PythonHidden] requires the class to have the [PythonType] (or
> [PythonModule]) attribute.
>
> - Jeff
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20141010/516711fc/attachment.html>


More information about the Ironpython-users mailing list