Skip to content

Instantly share code, notes, and snippets.

@PythonDotLand
Created June 29, 2021 07:47
Show Gist options
  • Select an option

  • Save PythonDotLand/6737ff43199abfecdc1dfe74c74a0115 to your computer and use it in GitHub Desktop.

Select an option

Save PythonDotLand/6737ff43199abfecdc1dfe74c74a0115 to your computer and use it in GitHub Desktop.
>>> class Card:
... __slots__ = 'rank', 'suite'
... def __init__(self, rank, suite):
... self.rank = rank
... self.suite = suite
...
>>> qh = Card('queen', 'hearts')
@AlkisPis
Copy link

AlkisPis commented Jul 2, 2021

I see. You are right. It seems I am too preoccupied with the subject of writing faster, so I isolated that! :) In fact, for a moment I believed that this "solts" thing allows for not having to add the very stupid, annoying and time wasting 'self' prefix everytime to e.g. 'rank' and 'suite' ! :)) (I know well though that it is necessary and why, as in Java, with the corresp. prefix 'this'.)
Thanks and sorry about the trouble!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment