From: Ivan V. i B. <iv...@ca...> - 2005-01-19 08:34:51
|
On Mon, Jan 17, 2005 at 09:17:08AM +0100, Norbert Nemec wrote: > The dictionary should, of course, contain only the names of immediate=20 > children. It would be __getitem__ that does the '/' parsing and looks up = the=20 > individual steps. dictionary key completion is not an issue. I was thinking about the Eric IDE, which somehow manages to complete values which are only returned by __getitem__ but are not in __dict__ (don't ask me how it does that). However, __dict__ lookup still works right in Eric regardless of __getitem__, so it seems that my proposal would break nothing indeed. I still admit that it might be confusing, so maybe another new method (e.g. getItem() or getPath()) would be a better choice. >=20 > Actually: __dict__ can even contain non-pythonic names. You just cannot q= uery=20 > them by natural naming, but ipython even shows these names in key complet= ion.=20 > Anyhow: it certainly would be confusing to have non-pythonic names in a= =20 > __dict__ ... I don't see potential trouble, unless you are using __dict__ keys to build expressions for 'eval' or 'exec', which could be avoided by the use of __getitem__. --=20 Ivan Vilata i Balaguer >qo< http://www.carabos.com/ C=E1rabos Coop. V. V V Enjoy Data "" |