class Bla(object): def __init__(self): self.a = 'abvc' self.voltage = 'ac' #class metoda ----- @classmethod def saySomethingClassic(cls): print('hi') print(cls) #static metoda ----- @staticmethod def saySomethingStatic(txt): print(txt) #property - zpusob 1. ----- voltage = property(doc="hello, this is documentation") @voltage.getter def voltage(self): print('voltage getter') return self._voltage; @voltage.setter def voltage(self, value=None): print('voltage setter') self._voltage = value #property - zpusob 2. ----- @property def current(self): print('curr getter') return self._current @voltage.deleter #tohle jde taky @current.setter def current(self, val = None): print('curr setter') self._current = val a = Bla() Bla.saySomethingClassic() Bla.saySomethingStatic('abcCfc') print(a.voltage) a.voltage = 'adsdasXXXd' print(a.voltage) print(Bla.voltage.__doc__) a.current = '1A' print(a.current)... no presto doufam, ze se odnaucim jako Javista pouzivat settery/gettery :]