I understand that the completer tries to get useful attribute names for Traits objects using the has_traits method, but this can be quite problematic. In my case, I have a class with an overriden __getattr__ where obj.foo() results in sending the "foo" instruction on a serial port, if "foo" does NOT start with an underscore (this allows me to have actual attributes, prefixed with an "_", as well). The actual list of valid names (i.e. valid serial port commands) is actually correctly returned by dir(obj) as I have overriden __dir__, but ipython's completer still tries to call trait_names, which sends an invalid command and puts the instrument at the other end of the serial connection in an error state :-(. So I had to special-case the "trait_names" attribute in my __getattr__, but that feels wrong.<br>
At least, it sounds reasonable that if a __dir__ method is defined then he who defined it probably knew what he was doing and therefore trait_names should not be tried?<br>Best,<br>Antony<br>