[issue6073] threading.Timer and gtk.main are not compatible

2009-05-20 Thread Eric Atienza

New submission from Eric Atienza e...@ericaro.net:

this simple code:

import gtk
from threading import Timer
from time import sleep

def p():
print p

Timer(1, p).start()

#gtk.main()
sleep(10)
print done
does print p a second after it starts.
when I remove the comment of the gtk.main() line: the p is never printed.

It is very exposed, as Timer is a common tool to build a GUI therefore
with the gtk.main() loop active.

--
components: Library (Lib)
messages: 88137
nosy: atienza
severity: normal
status: open
title: threading.Timer and gtk.main are not compatible
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6073
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4109] Wrong UnboundLocalError with += operator

2008-10-12 Thread Eric Atienza

New submission from Eric Atienza [EMAIL PROTECTED]:

the following code :

def test():
code=''
def sub(n):
for i in range(n):
code+=str(i)
sub(5)
sub(10)
return code

 test()
Traceback (most recent call last):
  File console, line 1, in module
  File console, line 6, in test
  File console, line 5, in sub
UnboundLocalError: local variable 'code' referenced before assignment

error came from the += operator.
Tested for code initialized to '', to 0
I guess it's the same for all inline operators.

I agree that global variables CANNOT be assigned, it's ok.

But += (and I guess *= etc) operators are not assignements, and are not 
different from .append(), or .extend() methods.

I was expecting += to work the same as append() method

--
components: Interpreter Core
messages: 74666
nosy: atienza
severity: normal
status: open
title: Wrong UnboundLocalError with += operator
type: behavior
versions: Python 2.5.3

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4109
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com