Why is __root checked for in OrderedDict?

andrew cooke andrew at acooke.org
Thu Apr 7 17:40:58 EDT 2011


Is that normal?  I mean, OK, it's possible (and yes I forgot it could be called directly), but is there any usual reason to do so?

I guess what I'm asking is: if I'm writing library code should I be this careful?   (I've written quite a lot of Python code without this ever biting me, but maybe I'm just lazy).  For example, would you consider it a bug if someone complained that calling __init__() resulted in unexpected behaviour?

Thanks,
Andrew



More information about the Python-list mailing list