Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107749 > unrolled thread

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

Started byChristopher Reimer <christopher_reimer@icloud.com>
First post2016-04-27 20:53 -0700
Last post2016-04-27 20:53 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Differences between Class(Object) and Class(Dict) for dictionary usage? Christopher Reimer <christopher_reimer@icloud.com> - 2016-04-27 20:53 -0700

#107749 — Re: Differences between Class(Object) and Class(Dict) for dictionary usage?

FromChristopher Reimer <christopher_reimer@icloud.com>
Date2016-04-27 20:53 -0700
SubjectRe: Differences between Class(Object) and Class(Dict) for dictionary usage?
Message-ID<mailman.167.1461815583.32212.python-list@python.org>
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.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web