From: Francesc A. <fa...@ca...> - 2004-12-10 08:40:44
|
A Divendres 10 Desembre 2004 08:23, Norbert Nemec va escriure: > > 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! >=20 > I like this idea. Yes, me too. However, that implies a few more more work, and perhaps a better redesign of *many* others exceptions in PyTables. While this a task that should be done, I'm still very tempted to use a KeyError, just to diferentiate behaviours. Although perhaps is still better to let the current LookupError (__getattr__ and __delattr__) and NameError (__setattr__) happening until the big exception redesing would happen. > It is clear that there is a conflict in naming between HDF5-Attributes an= d=20 > Python attributes. It is dangerous to implicitely say "When I talk of=20 > attributes, I mean ...-Attributes." The conflict is there and will cause= =20 > confusion for everyone if it is not addressed cleanly. >=20 > There should be some explicit policy in distinguishing between the two ty= pes=20 > of attributes. Unfortunately, I have no idea yet, what that might look=20 > like... Well, the pointed objects are already different (a Leaf or Group for HDF5 nodes and AttributeSet for HDF5 attributes). Another step would be providing different types for exceptions. =2D-=20 =46rancesc Altet Who's your data daddy? =A0PyTables |