A lot of time.
>>> if o.n == 1 and o.p == 1:takes about 1,4 times longer than
>>> if d['n'] == 1 and d['p'] == 1:Here are the results of iterating 10 000 000 times.
05.428000 seconds (obj)
03.896000 seconds (dict)
the actual runtime varies a little but the relation between the resulting values stays at about 1,4. Of course this metric is far too simple to base a decision about how to implement an Alpha Network on. As soon as I have a *complete* implementation of a Working Memory and an Alpha Network using a Linked List I'll perform a more realistic test.
In case you thought I forgot about:
>>>if o1.__dict__['n'] == 1 and o1.__dict__['p'] == 1:I didn't include them because the run time is worse than using dot notation. Here are the complete results of iterating 10 000 000 times.