Petr Zlamal wrote:
> Lze nejak v pythonu vypsat vsechny promenne nalezejici dane instanci.
Python primo nerozlisuje, ktere z atributu jsou "promenne" a ktere metody.
Vase potreba je nicmene pofiderni a naznacuje neoptimalni navrh programu
-- jen velmi zridka je neco takoveho potreba. Neznal ale podrobnosti.
Nicmene je to samozrejme mozne napriklad takto:

    >>> class A:
    ...    def __init__(self):
    ...       self.a=12
    ...       self.z='aaaa'
    ...    def tiskni(self):
    ...     print "Atributy instance: ", self.__dict__
    ...
    >>> a=A()
    >>> a.tiskni()
    Atributy instance:  {'a': 12, 'z': 'aaaa'}

-- 
\//\/\
http://macek.sandbox.cz
http://www.easis.cz

begin:vcard
fn:Vlada Macek
n:Macek;Vlada
adr:;;;Liberec;;;Czech Republic
email;internet:[email protected]
title:Software || Networking && UNIX
tel;cell:+420 608 978 164
note;quoted-printable:GPG info: key 0x1F059424, fingerprint 1494 F8DD 6379 4CD7 E7E3 1FC9 D7504=
	243 1F05 9424=0D=0A=
	=0D=0A=
	When you find a virus in mail from me, then I intended to infect you, sin=
	ce I use SW that is not distributing malware w/o my knowledge.=0D=0A=
	
x-mozilla-html:FALSE
url:http://macek.sandbox.cz
version:2.1
end:vcard

_______________________________________________
Python mailing list
[email protected]
http://www.py.cz/mailman/listinfo/python

Odpovedet emailem