micseydel wrote:I haven't worked with threading directly myself, so I don't have any comments on that. Same for logging.py. You're welcome to elaborate (especially on the Java connection) if you wish.
- Code: Select all
>>> import threading
"Thread module emulating a subset of Java's threading model."
threading.py is an OOP wrapper around threads. Instead of passing a function and arguments to thread.start_new_thread(), instances of threading.Thread() are created with the function and arguments passed to the constructor and then started by calling Thread.start(). There are some niceties thrown in, such as .join() which waits for the thread to finish execution, but nothing actually special. The real problem with the module is that the code is rotten to the core. Factory functions that literally do nothing but duplicate docstrings and obscure the actual __init__ signatures of the classes? No really.
As for logging.py, PEP 282 lists java.util.logging as one of its primary inspirations.
micseydel wrote:If Python started requiring a main() method of a class as the only means of writing Hello World then I'd get upset, or if a poor type system (I'm not a fan of Java's) was introduced that limited Python code (type hinting doesn't do this, even if today the type system isn't very sophisticated).
That's fair enough.