tag:blogger.com,1999:blog-2536364715247944978.post5600252787581470358..comments2023-10-17T07:27:49.260-07:00Comments on limscoder: Python Vs JavaDave Thompsonhttp://www.blogger.com/profile/05289219104297308435noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-2536364715247944978.post-5400803651887467852012-10-11T10:38:27.625-07:002012-10-11T10:38:27.625-07:00I hadn’t realized that `__methods` were deemed unp...I hadn’t realized that `__methods` were deemed unpythonic. Good to know! Thanks. :-)<br /><br />Zearinhttps://www.blogger.com/profile/07665890367428408286noreply@blogger.comtag:blogger.com,1999:blog-2536364715247944978.post-6172562373335840792012-01-19T10:49:32.935-08:002012-01-19T10:49:32.935-08:00So I saw your profile on StackOverflow and I'm...So I saw your profile on StackOverflow and I'm also a LIMS coder. I find myself using Jython almost every day for miscellaneous tasks related to LIMS development.Edhttp://edwardrbaker.comnoreply@blogger.comtag:blogger.com,1999:blog-2536364715247944978.post-12485573103935115962011-07-08T11:18:59.902-07:002011-07-08T11:18:59.902-07:00__methods are somewhat private, but the Python com...__methods are somewhat private, but the Python community has labeled them 'unpythonic'. __methods are considered to be a deprecated feature by many Python coders, and they are used very rarely in modern Python code.Dave Thompsonhttps://www.blogger.com/profile/05289219104297308435noreply@blogger.comtag:blogger.com,1999:blog-2536364715247944978.post-38986755233658494522011-07-08T06:33:52.545-07:002011-07-08T06:33:52.545-07:00HI, great article; i love PyJa war :D
I follow you...HI, great article; i love PyJa war :D<br />I follow you from ACL post! :)<br /><br />Just onr point:<br />In python you can declare a "private" object with a double _ [not only one] and, yes, you can continue to "control" it but in a different way (Why i've to cut my ball? :D). But for me is an interesting test/debug feature and not a lack :)<br /><br />for example a variable called self.__spam in a 'A' class can accessed with self._A__spam, but if you try with self.__spam you'll raise an AttributeError<br /><br /><br />>>> class A(object):<br />... def __init__(self):<br />... self.__spam = 'ham'<br />... def __egg(self):<br />... print 'private'<br />... <br />>>> a = A()<br />>>> a.__spam<br />Traceback (most recent call last):<br /> File "", line 1, in <br />AttributeError: 'A' object has no attribute '__spam'<br />>>> a.__egg()<br />Traceback (most recent call last):<br /> File "", line 1, in <br />AttributeError: 'A' object has no attribute '__egg'<br />>>> dir(a)<br />['_A__egg', '_A__spam', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']<br />>>> a._A__spam<br />'ham'<br />>>> a._A_egg()<br />Traceback (most recent call last):<br /> File "", line 1, in <br />AttributeError: 'A' object has no attribute '_A_egg'<br />>>> a._A__egg()<br />private<br /><br />see u,<br />Andrea, z4rz4rhttps://www.blogger.com/profile/15010359386927708669noreply@blogger.comtag:blogger.com,1999:blog-2536364715247944978.post-11544234614805351652011-07-07T11:06:04.114-07:002011-07-07T11:06:04.114-07:00check out Groovy, get back more dynamism for Java ...check out Groovy, get back more dynamism for Java devs<br /><br />and then Grails for Django?Land Rover Giftshttp://www.landrovergeeks.com/giftsnoreply@blogger.com