[issue12028] threading._get_ident(): remove it in the doc or make it public

2011-05-30 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 5548197d1f22 by Victor Stinner in branch 'default':
Close #12028: Make threading._get_ident() public, rename it to
http://hg.python.org/cpython/rev/5548197d1f22

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue12028] threading._get_ident(): remove it in the doc or make it public

2011-05-30 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 6387aa6b496d by Victor Stinner in branch 'default':
Issue #12028: fix NEWS entry
http://hg.python.org/cpython/rev/6387aa6b496d

--

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



[issue12028] threading._get_ident(): remove it in the doc or make it public

2011-05-24 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

threading_get_ident.patch: make get_ident() public, replace 
threading._get_ident() by threading.get_ident().

According to this patch, get_ident() function *is* used: it is used by the 
logging and reprlib modules (and many tests). My patch avoids the usage of the 
low-level module, _thread_, in logging and reprlib.

I adapted signal.pthread_kill() documentation to replace 
threading.current_thread().ident by threading.get_ident().

--
keywords: +patch
Added file: http://bugs.python.org/file22089/threading_get_ident.patch

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-23 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I find it strange that you propose to make a function public and remove its doc 
:)  Is a negative missing in the bug title?

--
nosy: +eric.araujo

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



[issue12028] threading._get_ident(): remove it in the doc or make it public

2011-05-23 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
title: threading._get_ident(): remove it in the doc and make it public - 
threading._get_ident(): remove it in the doc or make it public

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-16 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

@pitrou: What do you think Antoine?

--
nosy: +pitrou

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-16 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

The threading API changed in Python 3 with the PEP 3108, especially and issue 
#2875. Extract of the PEP:

thread [done]

 * People should use 'threading' instead.
   * Rename 'thread' to _thread.
   * Deprecate dummy_thread and rename _dummy_thread.
   * Move thread.get_ident over to threading.
 * Guido has previously supported the deprecation [13].

The issue was closed by the commit [7fe3a8648ce2], Issue #2875: Rename thread 
to _thread and dummy_thread to _dummy_thread.

--
nosy: +brett.cannon, georg.brandl

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-16 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 I think that threading._get_ident() is more reliable than
 threading.current_thread().ident because Thread.ident can be None in
 some cases.

In which case can it be None?

--

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-16 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 In which case can it be None?

Oh, I misunderstood threading.py. current_thread().ident cannot be None.

During the bootstrap of a thread, Thread._ident is None, but 
current_thread().ident is not None because current_thread() creates a dummy 
thread object having the right identifer. This dummy object is destroyed at 
soon as the Thread object is started (see Thread._bootstrap_inner).

current_thread().ident is a little bit suboptimal because it gets the 
identifier of the thread, it reads the corresponding thread object, and then it 
gets the identifier of the thread object.

def current_thread():
...
return _active[_get_ident()]
...

--

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-16 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
nosy: +rhettinger

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-07 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

I don't know why threading._get_ident() (which is _thread.get_ident()) is 
private: this function is safe.

This function becomes useful with pthread_kill() which will be added by #8407.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 135441
nosy: docs@python, haypo
priority: normal
severity: normal
status: open
title: threading._get_ident(): remove it in the doc and make it public
versions: Python 3.3

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



[issue12028] threading._get_ident(): remove it in the doc and make it public

2011-05-07 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I think that threading._get_ident() is more reliable than 
threading.current_thread().ident because Thread.ident can be None in some cases.

--

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