Code review comment for lp:~stefanor/ibid/calc-525439

Revision history for this message
Stefano Rivera (stefanor) wrote :

> I haven't really ever played with __new__ before, so I am not 100% what goes
> on with the setattr().

setattr(a, 'b', 'c') is the same as a.b = c
however, setattr doesn't know to do name mangling if you say setattr(a, '__b')

> Say a subclass, A, of processor has _Processor__event_handlers as [handler_a].
> Then B, a subclass of A, adds handler_b. So B._Processor__event_handlers is
> [handler_a, handler_b]?

Correct

> If so I am led to believe A. and Processor. _Processor__event_handlers is also
> [handler_a, handler_b]. Just wondering if this is intended and if this is how
> it works?

Ok, that bit I don't understand. Explain to me on IRC

> Also, maybe _Processor__*_handlers should be sets instead of lists?

No. Definable order could be handy.

« Back to merge proposal