From: Norbert N. <Nor...@gm...> - 2005-01-17 21:57:21
|
Am Sonntag, 16. Januar 2005 21:15 schrieb Ivan Vilata i Balaguer: > On Sun, Jan 16, 2005 at 06:00:50PM +0100, Norbert Nemec wrote: > > > Imagine issuing: > > > >>> # h5file.root.detector.readout <=> > > > >>> tbl = h5file.root['detector/readout'] > > > > or > > tbl = h5file.root['detector']['readout'] > > > > Anyhow: I don't see much gain here. Just the question whether you do the > > '/' parsing or not. Don't have much of an opinion there. > > It would simplify specifying a path (even leading to attributes if > necessary) and getting the object. However, doing so would make > dictionary key completion in some IDEs useless, so maybe it was not a > good idea in the end. The dictionary should, of course, contain only the names of immediate children. It would be __getitem__ that does the '/' parsing and looks up the individual steps. dictionary key completion is not an issue. Actually: __dict__ can even contain non-pythonic names. You just cannot query them by natural naming, but ipython even shows these names in key completion. Anyhow: it certainly would be confusing to have non-pythonic names in a __dict__ ... -- _________________________________________Norbert Nemec Bernhardstr. 2 ... D-93053 Regensburg Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199 eMail: <No...@Ne...> |