From: Ivan V. i B. <iv...@ca...> - 2005-10-11 09:10:16
|
En/na Norbert Nemec ha escrit:: > The proposal sounds reasonable to me. The only "uglification" that it > introduces is the trailing underscore for regular items. I think people= > can bear that. All the escaping should probably not appear in everyday > use. (Unless somebody wants to punish him/herself.) It certainly is goo= d > to have the predictability and the full power of tab-expansion. The trailing underscore may be ugly but I find it quite interesting that it makes child nodes instantly distinguishable from instance members. As you noted, escaping will not happen in most cases, since people tends to use id-like names. We people using accents and such in computing know we will come across trouble sooner or later... :-/ En/na Norbert Nemec ha escrit:: > One idea: would it make sense to consider __getitem__/__setitem__ as > alternative access method for children? It cannot offer tab-completion,= > but for non-interactive use, it might come in handy. I have been quite convinced for a while that this would be nice to have in PyTables, but I am not so sure now. At first, ``__setitem__()`` would require unbound nodes, and idea we do not like much (this is why ``__setattr__()`` of nodes no longer works). Then, I have developed some ideas against using the item interface: * I think the semantics of items is not related with the semantics of child nodes, so it may not be obvious to the user what ``group['nodename']`` does. * The natural naming interface is related with interactive usage, and programmatic usage would already have ``getChild()`` and similarly named methods. These are already two ways of doing the same thing, a third one is only confusing. I *really* would like to discuss these points a little more. Should groups, in your opinion, behave more like dictionaries? If that was the case, the item interface would make more sense, but then node attributes would look more strange to be placed in a separate ``attrs`` object. Cheers, :: Ivan Vilata i Balaguer >qo< http://www.carabos.com/ C=C3=A1rabos Coop. V. V V Enjoy Data "" |