Quote:
Originally Posted by Ownaginatios
Python's object-orientated paradigm is pretty crap compared to Java's.
|
it's actually not too shabby.
Code:
class Derp(object):
__private_variable = "test"
def __init__(self, param):
self.param = param
def print_param(self):
print self.param
def __private_method(self):
print "private %s" % self.param
d = Derp("hello")
d.print_param()
>> "hello"
d.__private_method()
>> AttributeError: 'Derp' instance has no attribute '__private_method'