[IronPython] private functions within a module

Justin Regele jregele23 at gmail.com
Thu Jun 18 23:07:43 CEST 2009


hahaha. thanks michael.



On Thu, Jun 18, 2009 at 1:38 PM, Michael Foord <fuzzyman at voidspace.org.uk>wrote:

> Justin Regele wrote:
>
>> As of Python25, there is no thing as a 'private' method, although the
>> _method() convention is what is generally used.
>>
>> also, staticmethod(objfunc) is used to make a method static. don't know if
>> yo already know this. rather an annoying way of doing it.
>>
>
> class Static(object):
>
>   @staticmethod
>   def method():
>      print 'this is a static method'
>
> Static.staticmethod()
>
> Not that you need them in Python - functions or class methods
> (@classmethod) are almost always better.
>
> Michael
>
>>
>> On Mon, Jun 15, 2009 at 11:34 AM, Michael Foord <
>> fuzzyman at voidspace.org.uk <mailto:fuzzyman at voidspace.org.uk>> wrote:
>>
>>    Elise Langham (Elanit) wrote:
>>
>>
>>        How can i define some functions within a module as private ?
>>
>>        Do i need to make them part of a static class ? or is this
>>        this not possible?
>>
>>
>>    The convention is to start their names with an underscore. That
>>    will tell other developers not to call them directly.
>>
>>    Michael
>>
>>        Thanks,
>>
>>                  Elise
>>
>>
>>  ------------------------------------------------------------------------
>>
>>        _______________________________________________
>>        Users mailing list
>>        Users at lists.ironpython.com <mailto:Users at lists.ironpython.com>
>>        http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>>
>>    --    http://www.ironpythoninaction.com/
>>    http://www.voidspace.org.uk/blog
>>
>>
>>    _______________________________________________
>>    Users mailing list
>>    Users at lists.ironpython.com <mailto:Users at lists.ironpython.com>
>>    http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>
>
> --
> http://www.ironpythoninaction.com/
> http://www.voidspace.org.uk/blog
>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090618/dd7f4dc3/attachment.html>


More information about the Ironpython-users mailing list