[Python-3000] PEP 3108: Standard Library Reorganization

Mike Orr sluggoster at gmail.com
Tue Jan 2 07:13:11 CET 2007


On 1/1/07, Brett Cannon <brett at python.org> wrote:
> * thread
>     + People should use 'threading' instead.

'threading' has no equivalent to 'thread.get_ident()'.  If this
function is ported, I'd support renaming 'thread'.  You need it to
print "Thread #123 doing bla bla bla" messages, to distinguish threads
in a thread pool, to keep track of thread-local data, etc.  The
threading.Thread name isn't the same thing because it's an arbitrary
string, not a guaranteed-unique integer, and the routine creating the
threads may be third-party and not setting unique identifiers.

> * stat
>     + ``os.stat`` now returns a tuple with attributes.

Certain things in 'stat' do not exist elsewhere:  S_ISCHR, S_ISBLK,
S_ISFIFO, S_ISSOCK.  These could be made into more friendly
os.path.is*() functions that take the pathname rather than the
st_mode.  I've never used them, but it would be a pity to make people
calculate the bitmasks manually.

> * fileinput

+1 to leave it.

-- 
Mike Orr <sluggoster at gmail.com>


More information about the Python-3000 mailing list