creating python keyed arrays
Question: im calling them keyed arrays because if i knew what they were called i could
find the answer myself =-)

ok, for example:

    
    
    parser = OptionParser(conflict_handler="resolve")
    parser.add_option("-x", dest="var_x",  help="")
    parser.add_option("-y", dest="var_y",  help="")
    
    
    (options, args) = parser.parse_args()
    

generates an option object that can be used like this:

    
    
    foobar = options.var_x
    

what are these called and where would i find some documentation on how to
create and use them?


Answer: One class that does something very similar is
[`namedtuple`](http://docs.python.org/library/collections.html#collections.namedtuple):

    
    
    In [1]: from collections import namedtuple
    
    In [2]: Point = namedtuple('Point', ['x', 'y'])
    
    In [4]: p = Point(1, 2)
    
    In [5]: p.x
    Out[5]: 1
    
    In [6]: p.y
    Out[6]: 2
    

