Re: [Tutor] how can I use unicode in ctypes?

2012-12-10 Thread Albert-Jan Roskam
- Original Message - > From: eryksun > To: Albert-Jan Roskam > Cc: Python Mailing List > Sent: Friday, December 7, 2012 7:39 PM > Subject: Re: [Tutor] how can I use unicode in ctypes? > > On Thu, Dec 6, 2012 at 2:39 PM, Albert-Jan Roskam wrote: >> >> http://pastecode.org/index.php

Re: [Tutor] memoize, lookup, or KIS?

2012-12-10 Thread Albert-Jan Roskam
(this thread may be closed already but...) while looking for something else, I found another cool way of memoizing: http://effbot.org/zone/default-values.htm It uses an empty dictionary as a function argument. Usually a source of confusion (for me at least!), but in this case I find it quite use

Re: [Tutor] how can I use unicode in ctypes?

2012-12-10 Thread eryksun
On Mon, Dec 10, 2012 at 5:15 AM, Albert-Jan Roskam wrote: > > Thanks. I modified it. Kinda annoying that the default encoding is ascii, but > I read that it could be changed with sys.setdefaultencoding and reload(sys) I wouldn't go against the grain here, especially for library code.

Re: [Tutor] Unexpected results with obj.method().method()

2012-12-10 Thread C M Caine
Thanks eryksun, that was the bug. Thanks for pointing out the tabs as well, they were added by vim's autoindent. I've set expandtab for python files now. I decided to change the code such that current_player and turn_number are hidden behind properties meaning I won't overwrite them accident or st

Re: [Tutor] Unexpected results with obj.method().method()

2012-12-10 Thread C M Caine
Thanks for the advice. As is often the case with these things, eryksun pointed out a stupid mistake I'd made (mutating part of an immutable class) that I should have seen. On 6 December 2012 00:50, Oscar Benjamin wrote: > On 5 December 2012 18:11, C M Caine wrote: > > Dear all, > > > > I've wr