Gregor Horvath wrote:
> Steven D'Aprano schrieb:
>
>
>>I don't know of many other OO languages that didn't/don't have
>>inheritance,
>
>
> VB4 - VB6
>
VB6 has a kind of inheritance via interface/delegation. The interface
part is for subtyping, the delegation part (which has to be done
manuall
Michele Simionato wrote:
> Roy Smith wrote:
>
>> That being said, you can indeed have private data in Python. Just prefix
>> your variable names with two underscores (i.e. __foo), and they effectively
>> become private. Yes, you can bypass this if you really want to, but then
>> again, you can b
Casey Hawthorne wrote:
>>I think it's important not to wrongly confuse 'OOP' with ''data hiding'
>>or any other aspect you may be familiar with from Java or C++. The
>>primary concept behind OOP is not buzzwords such as abstraction,
>>encapsulation, polymorphism, etc etc, but the fact that your pro
Ben C wrote:
> On 2006-04-11, Michele Simionato <[EMAIL PROTECTED]> wrote:
>
>>Roy Smith wrote:
>>
>>
>>>That being said, you can indeed have private data in Python. Just prefix
>>>your variable names with two underscores (i.e. __foo), and they effectively
>>>become private. Yes, you can bypass
Steven D'Aprano schrieb:
> I don't know of many other OO languages that didn't/don't have
> inheritance,
VB4 - VB6
--
Mit freundlichen Grüßen,
Ing. Gregor Horvath, Industrieberatung & Softwareentwicklung
http://www.gregor-horvath.com
--
http://mail.python.org/mailman/listinfo/python-list
Michele Simionato wrote:
> Roy Smith wrote:
>
> > That being said, you can indeed have private data in Python. Just prefix
> > your variable names with two underscores (i.e. __foo), and they effectively
> > become private. Yes, you can bypass this if you really want to, but then
> > again, you c
On Tue, 11 Apr 2006 18:20:13 +, Casey Hawthorne wrote:
>>I think it's important not to wrongly confuse 'OOP' with ''data hiding'
>>or any other aspect you may be familiar with from Java or C++. The
>>primary concept behind OOP is not buzzwords such as abstraction,
>>encapsulation, polymorphism
On 2006-04-11, Michele Simionato <[EMAIL PROTECTED]> wrote:
> Roy Smith wrote:
>
>> That being said, you can indeed have private data in Python. Just prefix
>> your variable names with two underscores (i.e. __foo), and they effectively
>> become private. Yes, you can bypass this if you really wan
>I think it's important not to wrongly confuse 'OOP' with ''data hiding'
>or any other aspect you may be familiar with from Java or C++. The
>primary concept behind OOP is not buzzwords such as abstraction,
>encapsulation, polymorphism, etc etc, but the fact that your program
>consists of objects m
Roy Smith wrote:
(snip)
> That being said, you can indeed have private data in Python. Just prefix
> your variable names with two underscores (i.e. __foo), and they effectively
> become private.
The double-leading-underscore stuff has nothing to do with "privacy".
It's meant to protect from
fyhuang wrote:
> Hello all,
>
> I've been wondering a lot about why Python handles classes and OOP the
> way it does. From what I understand, there is no concept of class
> encapsulation in Python, i.e. no such thing as a private variable.
Seems you're confusing encapsulation with data hiding.
>
Roy Smith wrote:
> That being said, you can indeed have private data in Python. Just prefix
> your variable names with two underscores (i.e. __foo), and they effectively
> become private. Yes, you can bypass this if you really want to, but then
> again, you can bypass private in C++ too.
Wrong,
Ben Sizer wrote:
> I think it's important not to wrongly confuse 'OOP' with ''data hiding'
> or any other aspect you may be familiar with from Java or C++. The
> primary concept behind OOP is not buzzwords such as abstraction,
> encapsulation, polymorphism, etc etc, but the fact that your program
fyhuang wrote:
> It seems to me that it is difficult to use OOP to a wide extent in
> Python code because these features of the language introduce many
> inadvertant bugs. For example, if the programmer typos a variable name
> in an assignment, the assignment will probably not do what the
> program
Hi,
fyhuang schrieb:
> I've been wondering a lot about why Python handles classes and OOP the
> way it does. From what I understand, there is no concept of class
> encapsulation in Python, i.e. no such thing as a private variable. Any
the answer is here:
http://tinyurl.com/obgho
--
Mit freund
fyhuang <[EMAIL PROTECTED]> wrote:
> [ ... ] no such thing as a private variable. Any
>part of the code is allowed access to any variable in any class, and
>even non-existant variables can be accessed: they are simply created.
You're confusing two issues: encapsulation and dynamic name binding.
Yo
Em Seg, 2006-04-10 às 07:19 -0700, fyhuang escreveu:
> class PythonClass:
>private foo = "bar"
>private var = 42
>allow_readwrite( [ foo, var ] )
You are aware that foo and var would become class-variables, not
instance-variables, right?
But you can always do:
class PythonClass(objec
"fyhuang" <[EMAIL PROTECTED]> wrote:
> I've been wondering a lot about why Python handles classes and OOP the
> way it does. From what I understand, there is no concept of class
> encapsulation in Python, i.e. no such thing as a private variable. Any
> part of the code is allowed access to any vari
You can do this in Python as well. Check out the property built-in
function. One can declare a property with a get, set, and delete
method. Here's a small example of a read-only property.
class Test(object):
def getProperty(self):
return 0;
prop = property(fget = getProperty)
Hello all,
I've been wondering a lot about why Python handles classes and OOP the
way it does. From what I understand, there is no concept of class
encapsulation in Python, i.e. no such thing as a private variable. Any
part of the code is allowed access to any variable in any class, and
even non-e
20 matches
Mail list logo