Omlouvám se, samozřejmě v té ukázce má být class uhel a class zemepisny_uhel namísto def, ale to jste asi pochopili.
Miloslav Ponkrác > def uhel: > @staticmethod > def static_str_na_radiany(s): > # tato metoda umi konvertovat matematicky > # uhel zapsany ve stringu na radiany > return blablabla; > > def __add__(self, other): > if isinstance(other, basestring): > return uhel(self.__radians + self.static_str_na_radiany(other)); > elseif: > # a tak dale > > def zemepisny_uhel(uhel): > def static_str_na_radiany(s): > # tato metoda umi konvertovat zemepisny > # uhel zapsany ve stringu na radiany > # na rozdil od stejne metody v predkovi > # umi konvertovat i GPS souradnice > return blablabla; > > zem_uhel = zemepisny_uhel(30.0) > zem_uhel = zem_uhel + "30N54" _______________________________________________ Python mailing list [email protected] http://www.py.cz/mailman/listinfo/python
