Python
- 2 ответа
- 0 вопросов
0
Вклад в тег
class SomeClass:
def __init__(self, health=20):
self._health = health
self._init_health = self._health
@property
def health(self):
return self._health
@health.setter
def health(self, value):
self._health = value
@property
def init_health(self):
return self._init_health
class SomeClass:
def __init__(self, health=20):
self._health = health
import inspect
inspect.getargspec(SomeClass.__init__)
ArgSpec(args=['self', 'health'], varargs=None, keywords=None, defaults=(20,))
self.health = 15