Style Q: Instance variables defined outside of __init__

Chris Angelico rosuav at gmail.com
Mon Mar 19 13:34:16 EDT 2018


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



More information about the Python-list mailing list