Re: [Tutor] Object, methods, class

2011-02-26 Thread Knacktus
Once again a very insightfull answer. Much appreciated! Same to you, Alan. I paricularly like the "even longer answer". It remindes us of how lucky we are using Python and brings me light in dark times when I wish I had better code completion in my IDE for my own spaghetti-code ;-)) ___

Re: [Tutor] Object, methods, class

2011-02-26 Thread Alan Gauld
"Christopher Brookes" wrote Is there in Python private/protected attributes in class like in other langage ? Steven has given you a comprehensive answer but as a bit of history none of the early OOP languages used public/protected/private etc. They either made all variables private (Smallta

Re: [Tutor] Object, methods, class

2011-02-26 Thread Steven D'Aprano
Christopher Brookes wrote: Hi, Is there in Python private/protected attributes in class like in other langage ? There's a short answer, a long answer, and an even longer answer. The short answer is No. The long answer is, not exactly. Python has private names, but they are not enforced by t

Re: [Tutor] Object, methods, class

2011-02-26 Thread Knacktus
Am 26.02.2011 18:49, schrieb Christopher Brookes: Hi, Is there in Python private/protected attributes in class like in other langage ? Yes, there is. But it's protected by convention not compiler ;-). Check out this: http://docs.python.org/tutorial/classes.html#private-variables -- Brookes Chr

[Tutor] Object, methods, class

2011-02-26 Thread Christopher Brookes
Hi, Is there in Python private/protected attributes in class like in other langage ? -- Brookes Christopher. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor