Differences between Class(Object) and Class(Dict) for dictionary usage?

Christopher Reimer christopher_reimer at icloud.com
Wed Apr 27 23:53:00 EDT 2016


On 4/27/2016 8:05 PM, Ethan Furman wrote:
> I ripped out the fetch_state because that will take more work -- you 
> can't pass a Pawn's saved state in to Piece and get the results you 
> want.  pickle is worth looking at for saving/restoring.

The original idea was to pass a Pawn dictionary to the constructor of 
the Pawn object. The Piece object will throw a NotImplementedError if 
called directly. I guess I'll have to look at pickle sooner rather than 
later.

> Also, your code will give the same notation to Kings and Knights.

Good catch. I knew I was forgetting something. I overrode variable in 
the Knight class to produce the correct notation.

Thank you,

Chris R.



More information about the Python-list mailing list