osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Style Q: Instance variables defined outside of __init__


On Tue, Mar 20, 2018 at 4:25 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
> Define them in __init__; otherwise, you get an error if reveal() is called
> before conceal() is.  Also, a card is either revealed or concealed, it can't
> be both and it can't be neither -- so set it in __init__.

__init__ calls conceal.

ChrisA