|
From: Norbert N. <Nor...@gm...> - 2004-12-10 07:27:35
|
Am Freitag, 10. Dezember 2004 00:23 schrieb Ivan Vilata i Balaguer:
> On Thu, Dec 09, 2004 at 08:34:07PM +0100, Francesc Altet wrote:
> > [...]
> > It just happens that "fileh.root.table" is
> > the way that PyTables has chosen to specifiy a node in the object tree
> > (the so-called "natural naming"). This is why I think there is an
> > intrinsic difference between a "node" and an "attribute", and why they
> > should be treated differently (even raise different exceptions).
>
> However, at a Python level, nodes are accessed as attributes (or
> members), so the right exception should be AttributeError. If we want
> to give this kind of access an additional meaning in PyTables, then
> maybe a new subclass of AttributeError (e.g NodeError) should be
> defined and used instead. In addition, this would not break
> compatibility with existing code where AttributeError was caught.
> Well, this is just an alternative. Bye!
I like this idea.
It is clear that there is a conflict in naming between HDF5-Attributes and
Python attributes. It is dangerous to implicitely say "When I talk of
attributes, I mean ...-Attributes." The conflict is there and will cause
confusion for everyone if it is not addressed cleanly.
There should be some explicit policy in distinguishing between the two types
of attributes. Unfortunately, I have no idea yet, what that might look
like...
--
_________________________________________Norbert Nemec
Bernhardstr. 2 ... D-93053 Regensburg
Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199
eMail: <No...@Ne...>
|