OK, I get it now. Thanks to David for his comments.
In the book I have been reading on classes, it says class methods need
to have self added, but it doesn't explain why. When I saw references in
the method referring to self.a or self.b, I assumed it was making
references directly to the instance namespace, because I hadn't thought
about the implications of passing an object called self to the method. So
the references to the object are passed into the local namespace, and the
method is making local references, which is consistent with the behavior of
functions in the global namespace.
It was helpful just to ask the question - sorry if I wasted anyone's
time reading it.