New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc mistake : threading.Timer is *not* a class #50081
Comments
In the documentation, the Timer() function of the threading class is >>> import threading
>>> threading.Timer
<function Timer at 0x967495c> Cheers Maxence |
The Timer function is a simple wrapper for creating an instance of the The Timer class was proposed in bpo-428326 by Itamar and applied The change would appear to intentionally make it difficult to create The Timer function/class was added in 2001 and there are no complaints I think I'd prefer deleting the function and naming the class Timer, Martin, do you have any memory of why you made Timer a function? Was it |
I deleted this function and I renamed the class _Timer to Timer. I |
Nearly all classes in threading uses this function/class indirection, which I don’t understand (except for RLock, which is a factory function). |
Explanation has been provided on bpo-10968, and hopefully the code will be cleaned up. Closing as superseded. |
Note this is a behaviour change. Under the old scheme (Foo is a class) Foo.timerclass = Timer created a method, whereas now it will just assign the class as an attribute. To work around this you had to use _Timer. Will that dummy class remain as an alias to avoid breaking code (in 2.7 at least)? |
Discussion should be moved to bpo-10968, please. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: