[issue18882] Add threading.main_thread() function

2014-03-07 Thread Andrew Svetlov
Andrew Svetlov added the comment: Implementation uses the first choice: main_thread() returns the original _MainThread instance, even if it's dead in the child process. I'm sorry, would you guess desired documentation change? -- ___ Python tracker

[issue18882] Add threading.main_thread() function

2014-02-23 Thread R. David Murray
R. David Murray added the comment: In msg196529 Antoine says there are two possible interpretations of main_thread, and we must choose one. However, the documentation does not indicate which one was chosen. -- nosy: +r.david.murray ___ Python track

[issue18882] Add threading.main_thread() function

2013-09-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > BTW 'threading' module has almost no docstrings, that's why I've > added only docs at first. > Do you think docstrings should be added to all public functions? Well, probably, although that's another issue :) -- __

[issue18882] Add threading.main_thread() function

2013-09-04 Thread Andrew Svetlov
Andrew Svetlov added the comment: I did not received review email, sorry. Docstring is added. BTW 'threading' module has almost no docstrings, that's why I've added only docs at first. Do you think docstrings should be added to all public functions? Thanks. -- _

[issue18882] Add threading.main_thread() function

2013-09-03 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't think you saw my review, but could you add a docstring to the main_thread() function? Thanks! -- ___ Python tracker ___ ___

[issue18882] Add threading.main_thread() function

2013-09-03 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue18882] Add threading.main_thread() function

2013-09-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 96e55a1a0de7 by Andrew Svetlov in branch 'default': Issue #18882: Add threading.main_thread() function. http://hg.python.org/cpython/rev/96e55a1a0de7 -- nosy: +python-dev ___ Python tracker

[issue18882] Add threading.main_thread() function

2013-08-31 Thread Andrew Svetlov
Andrew Svetlov added the comment: Uploaded new patch. > - the doc addition needs a "versionadded" tag Fixed. > - "The main thread is the thread that the OS creates to run application.": I > would rephrase this "In normal conditions, the main thread is the thread from > which the Python interp

[issue18882] Add threading.main_thread() function

2013-08-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Ok, some comments about the patch (no "review" links appears so I'm gonna do it inline here): - the doc addition needs a "versionadded" tag - "The main thread is the thread that the OS creates to run application.": I would rephrase this "In normal conditions,

[issue18882] Add threading.main_thread() function

2013-08-31 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Library (Lib) nosy: +serhiy.storchaka stage: -> patch review type: -> enhancement ___ Python tracker ___ _

[issue18882] Add threading.main_thread() function

2013-08-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: There is updated patch. All tests pass. I've added docs for threading.main_thread() function also. -- Added file: http://bugs.python.org/file31530/issue18882-2.diff ___ Python tracker

[issue18882] Add threading.main_thread() function

2013-08-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > http://bugs.python.org/issue16500 is required to make work after > fork from thread other than the main one. No it isn't. Please take a look at _after_fork() in threading.py. -- dependencies: -Add an 'atfork' module _

[issue18882] Add threading.main_thread() function

2013-08-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: http://bugs.python.org/issue16500 is required to make work after fork from thread other than the main one. -- dependencies: +Add an 'atfork' module ___ Python tracker

[issue18882] Add threading.main_thread() function

2013-08-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: signal module reinitializes main_thread variable in PyOS_AfterFork, threading does nothing with forking. -- ___ Python tracker ___

[issue18882] Add threading.main_thread() function

2013-08-30 Thread Andrew Svetlov
Andrew Svetlov added the comment: Patch with code and tests is attached. Test fails when program forks from thread other than the main one. -- keywords: +patch Added file: http://bugs.python.org/file31519/issue18882.diff ___ Python tracker

[issue18882] Add threading.main_thread() function

2013-08-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > The function must take care of fork() in worker threads, too. The > isinstance(current_thread(), _MainThread) trick may not work. Well, there are two possibilities: - main_thread() returns the original _MainThread instance, even if it's dead in the child pro

[issue18882] Add threading.main_thread() function

2013-08-30 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue18882] Add threading.main_thread() function

2013-08-30 Thread Christian Heimes
Christian Heimes added the comment: The function must take care of fork() in worker threads, too. The isinstance(current_thread(), _MainThread) trick may not work. -- ___ Python tracker ___

[issue18882] Add threading.main_thread() function

2013-08-30 Thread Christian Heimes
Changes by Christian Heimes : -- nosy: +christian.heimes ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue18882] Add threading.main_thread() function

2013-08-30 Thread Andrew Svetlov
New submission from Andrew Svetlov: We need public API for getting main thread object. See also http://comments.gmane.org/gmane.comp.python.devel/141370 -- messages: 196521 nosy: asvetlov, haypo, pitrou priority: normal severity: normal status: open title: Add threading.main_thread() fun