Re: stupid simple scope issue

2013-08-05 Thread JohnD
On 2013-08-04, Chris Angelico ros...@gmail.com wrote: On Sun, Aug 4, 2013 at 8:21 PM, JohnD j...@nowhere.com wrote: On 2013-08-04, Chris Angelico ros...@gmail.com wrote: [...] Python does have a slightly odd (compared to other languages) interpretation of variable assignments (name bindings,

stupid simple scope issue

2013-08-04 Thread JohnD
After 5 year of no Python programming I decided that I needed to brush up my skills. Started writing on a reasonably complicated problem. Unfortunately my basic Python skill are gone. I present the bare-bore problem. This code does not produce the expected result: can anyone tell me why? As you

Re: stupid simple scope issue

2013-08-04 Thread Chris Angelico
On Sun, Aug 4, 2013 at 7:20 PM, JohnD j...@nowhere.com wrote: #~/usr/bin/python If this is meant to be a Unix-style shebang, the second character needs to be ! not ~. This has no effect on Python though. import random class boys: state={} class boy: state={ 'name':'',

Re: stupid simple scope issue

2013-08-04 Thread JohnD
On 2013-08-04, Chris Angelico ros...@gmail.com wrote: [...] Thank you very much. The dust is slowly starting to move. The code posted is nothing like the real thing, but I tried to capture the essence. From your commants I think I see my mistake. Thank you very much for your reply! --

Re: stupid simple scope issue

2013-08-04 Thread Chris Angelico
On Sun, Aug 4, 2013 at 8:21 PM, JohnD j...@nowhere.com wrote: On 2013-08-04, Chris Angelico ros...@gmail.com wrote: [...] Thank you very much. The dust is slowly starting to move. The code posted is nothing like the real thing, but I tried to capture the essence. From your commants I think