Re: Help debugging a script that is using ZODB.

Michael Howitz <[email protected]> Mon, 11 May 2020 08:01:41 +0200
Newsgroups gmane.comp.web.zope.zodb
Message-ID <[email protected]>
--Apple-Mail=_6180F9F6-9EFA-4695-9252-A89864145623
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="UTF-8"

Hi!

Am 09.05.2020 um 17:57 schrieb [email protected]:
> I am trying to debug a script that is using ZODB. It is hard to tell if s=
ome of the methods are functioning correctly because the information the de=
bugger displays does not tell me worthwhile information. Information such a=
s "<__main__.Coord object at 0x00000000147FA908 oid 0x1185 in <Connection a=
t 03c395c0>>" is displayed in the debugger, but it doesn't tell me informat=
ion that is useful while debugging. I would like to know the safe way of ch=
anging what is displayed for a persistent object. I already tried adding a =
"__str__" method, but that did not change the display. I am using python 3.=
7 with ZODB 5.5.1.

You should add a __repr__ method to your Coord object returning the informa=
tion you need to debug. That method is called when printing the representat=
ion of an object.


--
Mit freundlichen Gr=C3=BC=C3=9Fen
Michael Howitz

--=20
You received this message because you are subscribed to the Google Groups "=
zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/=
zodb/06B744F0-5F27-455D-B98F-57B12084A4D6%40gmx.net.

--Apple-Mail=_6180F9F6-9EFA-4695-9252-A89864145623
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEzRcZ5x+BCFYq+baDYQXEIR/92gQFAl646kUACgkQYQXEIR/9
2gQ0jQf+MdspHWvHZkNJlf1GLwVD6vfOoDjVkZQMjP8UD0fdqOclVRYT/Y78G8++
nPGPgQbyIswsO1438j0beh+X/R+RAEwZOgIYcVl/3vFByaJOggFm5vDPuuuB1Ep3
/x10skUmcMGu8r2F4+Hoyh1OyOpLieKDroKcvFcSfYUSQ5h8Tx332ltSAZp4I/nt
IA5UMBGkTeuiA1fJqbN80StrhBpdPSiPXK704RMZCOXXmhXlkeUV/FXOeK/XieQs
lDBGuSP8O3jCrJvpQHodMk2cknbRahZ9q9pIiGljt9qiU/qBfs0gYUbq6An7zhc2
Wst38dNfbXouKXUzGIzweCEjY8Y8Qg==
=I/pb
-----END PGP SIGNATURE-----

--Apple-Mail=_6180F9F6-9EFA-4695-9252-A89864145623--