I would agree that the natural naming can easily get in the way. For
example, I tried storing stock data into pytables using the ticker
symbol as the table name. However, as it stands you can't use "def" as
a table name; the "checkNameValidity" function throws a NameError, since
"def" is a python reserved word. To me this is reminiscent of DOS
preventing the use of filenames "prn" or "con". It is easy to find
workarounds, but ugly since you have to deal with a lot of special cases.
I think a preferable method would use getitem/setitem as the primary
mechanism to access tree nodes, allowing complete freedom in node name
specification. Then for cases where the naming allows, the
getattr/setattr could be used also, thus preserving the simplicity of
natural naming for the simple cases.
Cheers, -Russ
>I know that natural naming is seen as one of the important features of
>pytables. For interactive use, this certainly is true. For me - mainly using
>scripts - it gets in the way quite often. I'm using getattr/setattr more
>often than natural naming, since the attribute names are quite often handled
>as strings.
|