| 109 | # class attribute 'bar'. This forces `getattr` to call __getattr__ |
| 110 | # (which is doesn't necessarily do). |
| 111 | class Foo: |
| 112 | calls = 0 |
| 113 | bar = '' |
| 114 | def __getattribute__(self, name): |
| 115 | if name == 'bar': |
| 116 | self.calls += 1 |
| 117 | return None |
| 118 | return super().__getattribute__(name) |
| 119 | |
| 120 | f = Foo() |
| 121 | completer = rlcompleter.Completer(dict(f=f)) |
no outgoing calls