From: <gh...@gh...> - 2006-08-18 21:55:21
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mignon Laurent wrote: > Hy, > > In your python abstraction layer (pgsql.py) you directly access the > __dict__ . If I understand the code, you use this mechanism in > conjunction of the overriding of __setattr__ to control the acces to > some attributes that you want readonly. > I can understand that that was in the past the only way to control > access to some attributes. Today, python allow you to define property > and to control access to a variable through getter and setter ... > The fact that the code access direclyt to the __dict__ is a problem for > me when I use this module in threads running in restricted mode (access > is denied!). Can I rewrite the code to use property and avoid the > access to the __dict__. Do you think that it is a good thing? You can of course rewrite the code yourself for your own uses. The reason pyPgSQL uses tricks with __dict__ is that it was written with Python 2.1 compatibility in mind. If the code was written today, it would of course be written using modern Python features :-) - -- Gerhard -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFE5jdUdIO4ozGCH14RAnUvAKCOjGttmaZ0aR/R44VUCmt/iZvmDwCeO2vk hnuM0hXIF+/72MLWdjUYuhE= =LynY -----END PGP SIGNATURE----- |