labrad / pylabrad

python interface for labrad
50 stars 31 forks source link

__dir__ in client.py no longer returns a list in python 3 #355

Closed fanmingyu212 closed 5 years ago

fanmingyu212 commented 5 years ago

IPython tab complete no longer works with python 3.6. It worked previously in python 2.7. Calling the list() constructor on the key() generator in the following line solves the issue. https://github.com/labrad/pylabrad/blob/edce74b094333b3457719cf02001147d45e7c0e5/labrad/client.py#L242

Changed code so autocomplete work: return sorted(set(list(self._attrs.keys()) + list(self.__dict__.keys()) + dir(type(self))))