[issue13077] Unclear behavior of daemon threads on main thread exit

2011-10-01 Thread etuardu

etuardu edo...@gmail.com added the comment:

Let me put it this way: the definition of daemon thread describes the behaviour 
of the Python program running it (its exit condition in particular) instead of 
going straight to the point describing the behaviour of the daemon thread 
itself first, and finally add other considerations.

Specifically, I think a situation like the following is not quite clear from 
the given definition:
- I have a main thread and a secondary thread, both printing to stdout.
- At some point, I press Ctrl+c raising an unhandled KeyboardInterrupt 
exception in the main thread, which kills it.

This is what I get using a daemon thread:

etuardu@subranu:~/Desktop$ python foo.py # other = daemon
other thread
main thread
other thread
main thread
^C
Traceback [...]
KeyboardInterrupt
etuardu@subranu:~/Desktop$ # process terminates

This is what I get using a non-daemon thread:

etuardu@subranu:~/Desktop$ python foo.py # other = non-daemon
other thread
main thread
other thread
main thread
^C
Traceback [...]
KeyboardInterrupt
other thread
other thread
other thread
... (process still running)

So, to explain the significance of the daemon flag, I'd say something like:

A daemon thread is shut down when the main thread and all others non-daemon 
threads end.
This means a Python program runs as long as non-daemon threads, such as the 
main thread, are running.
When only daemon threads are left, the Python program exits.

Of course this can be understood from the current definition («the entire 
Python program exits when only daemon threads are left»), still it looks a bit 
sybilline to me.

--
Added file: http://bugs.python.org/file23283/foo.py

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



[issue13077] Unclear behavior of daemon threads on main thread exit

2011-09-30 Thread etuardu

New submission from etuardu edo...@gmail.com:

The definition of daemon thread in the current documentation reads:

«A thread can be flagged as a daemon thread. The significance of this flag is 
that the entire Python program exits when only daemon threads are left. [...]»
(http://docs.python.org/library/threading.html#thread-objects)

I think it's not very clear from this that daemon threads themselves terminate 
when the program (main thread plus other non-daemon threads) terminates. I 
think this have to be said more explicitly. I'd propose a change with something 
like:

«A thread can be flagged as a daemon thread, which means it will get shut 
down when the overall program terminates. The entire Python program exits when 
only daemon threads are left.»

--
assignee: docs@python
components: Documentation
messages: 144691
nosy: docs@python, etuardu
priority: normal
severity: normal
status: open
title: Unclear behavior of daemon threads on main thread exit
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue13039] IDLE editor: shell-like behaviour on line starting with

2011-09-28 Thread etuardu

etuardu edo...@gmail.com added the comment:

Note that this does not affect just pasted code, you can reproduce it typing on 
a new line three greater-than signs plus a space, and then trying to use 
backspace. One might want to legitimately do that in a module docstring, e.g.:

This module provides this:
 foo()
True


--
title: IDLE3 editor: shell-like behaviour on line starting with  - IDLE 
editor: shell-like behaviour on line starting with 

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



[issue13039] IDLE3 editor: shell-like behaviour on line starting with

2011-09-23 Thread etuardu

New submission from etuardu edo...@gmail.com:

In the editor window, if a line starts with the shell prompt string , 
backspacing is inhibited when reaching the first space, just like in the shell 
window.

OS: Linux 2.6.38-11-generic-pae #50-Ubuntu i386 GNU/Linux
Python version: 3.2
IDLE version: 3.2
Tk version: 8.5

--
components: IDLE
messages: 144478
nosy: etuardu
priority: normal
severity: normal
status: open
title: IDLE3 editor: shell-like behaviour on line starting with 
type: behavior
versions: Python 3.2

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