barneygale / mark2

minecraft server wrapper, written in python with twisted
Other
105 stars 27 forks source link

Update user_client.py #78

Closed punkeel closed 11 years ago

punkeel commented 11 years ago

Fixes #77

No, still getting the error 06aa6e2 (file mk2/user_client.py, line 415) Error: self._default = list(set(self.HIDE, self.SHOW) - set(action))[0] exceptions.TypeError: set expected at most 1 arguments, got 2

Why not using this :

if action == self.HIDE:
  self._default = self.SHOW
else:
  self._default = self.HIDE
edk0 commented 11 years ago

Looks good, though I don't like parentheses round things that don't need them :P

The reason I used sets is simple enough: it was really concise (especially with the {...} syntax in python 2.7) and I don't like conditionals for cases that don't really seem conditional in my head.