Re: A syntax question

2014-11-11 Thread alister
On Mon, 10 Nov 2014 19:53:56 -0500, Dennis Lee Bieber wrote: > On Mon, 10 Nov 2014 14:56:11 GMT, alister > declaimed the following: > >>On Mon, 10 Nov 2014 14:54:55 +, alister wrote: >> >>> On Mon, 10 Nov 2014 14:44:53 +, Grant Edwards wrote: >>> On 2014-11-10, David Palao wrote:

Re: A syntax question

2014-11-10 Thread Tim Chase
On 2014-11-10 20:08, Mark Lawrence wrote: > On 10/11/2014 11:31, David Palao wrote: > >> My crystal ball is currently in for repair and is not expected > >> back in the foreseeable future. > > > > Without a crystal ball, this prediction might be not well founded. > > > > Especially in the future w

Re: A syntax question

2014-11-10 Thread Mark Lawrence
On 10/11/2014 11:31, David Palao wrote: My crystal ball is currently in for repair and is not expected back in the foreseeable future. Without a crystal ball, this prediction might be not well founded. Especially in the future when sombody asks "Who the hell was he replying to?". -- My fe

Re: A syntax question

2014-11-10 Thread Roy Smith
In article , Chris Angelico wrote: > On Tue, Nov 11, 2014 at 3:11 AM, Grant Edwards > wrote: > > I know, but in c.l.p, even jokes get nicely pednatic answers. > > And in c.l.p, odd jokes get even more pedantic spelling corrections. > > ChrisA a n d i m a g i n a r y j o k e s g e t r o

Re: A syntax question

2014-11-10 Thread Chris Angelico
On Tue, Nov 11, 2014 at 3:11 AM, Grant Edwards wrote: > I know, but in c.l.p, even jokes get nicely pednatic answers. And in c.l.p, odd jokes get even more pedantic spelling corrections. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: A syntax question

2014-11-10 Thread Grant Edwards
On 2014-11-10, alister wrote: > On Mon, 10 Nov 2014 14:44:53 +, Grant Edwards wrote: > >> On 2014-11-10, David Palao wrote: >> My crystal ball is currently in for repair and is not expected back in the foreseeable future. >>> >>> Without a crystal ball, this prediction might be not

Re: A syntax question

2014-11-10 Thread Joel Goldstick
On Mon, Nov 10, 2014 at 9:54 AM, Chris Angelico wrote: > On Tue, Nov 11, 2014 at 1:35 AM, Joel Goldstick > wrote: >> Your problem is that count is not local. You are reading count from >> an outer scope. When you try to increment count in your function, it >> can't because it doesn't exist. >>

Re: A syntax question

2014-11-10 Thread Peter Otten
Joel Goldstick wrote: > On Mon, Nov 10, 2014 at 6:39 AM, Wolfgang Maier > wrote: >> You may want to read: >> >> https://docs.python.org/3/faq/programming.html?highlight=global#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value >> >> from the Python docs Programming FAQ section. >

Re: A syntax question

2014-11-10 Thread alister
On Mon, 10 Nov 2014 14:54:55 +, alister wrote: > On Mon, 10 Nov 2014 14:44:53 +, Grant Edwards wrote: > >> On 2014-11-10, David Palao wrote: >> My crystal ball is currently in for repair and is not expected back in the foreseeable future. >>> >>> Without a crystal ball, this p

Re: A syntax question

2014-11-10 Thread alister
On Mon, 10 Nov 2014 14:44:53 +, Grant Edwards wrote: > On 2014-11-10, David Palao wrote: > >>> My crystal ball is currently in for repair and is not expected back in >>> the foreseeable future. >> >> Without a crystal ball, this prediction might be not well founded. > > That isn't a predict

Re: A syntax question

2014-11-10 Thread Chris Angelico
On Tue, Nov 11, 2014 at 1:35 AM, Joel Goldstick wrote: > Your problem is that count is not local. You are reading count from > an outer scope. When you try to increment count in your function, it > can't because it doesn't exist. > Don't use globals. False analysis, I'm afraid. The problem is t

Re: A syntax question

2014-11-10 Thread Grant Edwards
On 2014-11-10, David Palao wrote: >> My crystal ball is currently in for repair and is not expected back >> in the foreseeable future. > > Without a crystal ball, this prediction might be not well founded. That isn't a prediction. It's an explicit statement of no prediction. He said that it is

Re: A syntax question

2014-11-10 Thread Joel Goldstick
On Mon, Nov 10, 2014 at 6:39 AM, Wolfgang Maier wrote: > You may want to read: > > https://docs.python.org/3/faq/programming.html?highlight=global#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value > > from the Python docs Programming FAQ section. > It explains your problem pretty

Re: A syntax question

2014-11-10 Thread Wolfgang Maier
You may want to read: https://docs.python.org/3/faq/programming.html?highlight=global#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value from the Python docs Programming FAQ section. It explains your problem pretty well. As others have hinted at, always provide concrete Python

Re: A syntax question

2014-11-10 Thread David Palao
> My crystal ball is currently in for repair and is not expected back in > the foreseeable future. Without a crystal ball, this prediction might be not well founded. -- https://mail.python.org/mailman/listinfo/python-list

Re: A syntax question

2014-11-10 Thread alister
On Mon, 10 Nov 2014 12:07:58 +0100, Mok-Kong Shen wrote: > I don't understand the following phenomenon. Could someone kindly > explain it? Thanks in advance. > > M. K. Shen > > - > > count=5 > > def test(): >print(count) >if count==5: >

A syntax question

2014-11-10 Thread Mok-Kong Shen
I don't understand the following phenomenon. Could someone kindly explain it? Thanks in advance. M. K. Shen - count=5 def test(): print(count) if count==5: count+=0 ### Error message if this line is active, otherwise ok. print(cou