Greg Ewing wrote:
Travis E. Oliphant wrote:
PEP: <unassigned> Title: Adding data-type objects to the standard library
Not sure about having 3 different ways to specify the structure -- it smacks of Too Many Ways To Do It to me.
You might be right, but they all have use-cases. I've actually removed most of the multiple ways that NumPy allows for creating data-types.
Also, what if I want to refer to fields by name but don't want to have to work out all the offsets
I don't know what you mean. You just use the list-style to define a data-format with fields. The offsets are worked out for you. The only use for offsets was the dictionary form. The dictionary form stems from a desire to use the fields dictionary of a data-type as a data-type specification (which it is essentially is).
-Travis