class Fruit(object):
def __init__(self, concept):
self.concept = concept
- , , , . , , ( Python , , ).
:
class Fruit(object):
def __init__(self, concept):
self.concept = concept
self._super_secret_key = get_secret_key(concept)
, , _super_secret_key ( , ), _, , .
, __init__ , (, ) . , __init__ python?.
class Fruit(object):
def __init__(self):
self.concept = "I am a fruit"
test = Fruit()
test.concept = 'Whatever I want'
. , concept ? (.. , Fruit), .
class Fruit(object):
concept = "I am a fruit"
, concept , . , :
In [1]: class Fruit(object):
...: concept = "I am a fruit"
...:
In [2]: a = Fruit()
In [3]: a.concept
Out[3]: 'I am a fruit'
In [4]: Fruit.concept = "I am NOT a fruit"
In [5]: a.concept
Out[5]: 'I am NOT a fruit'