This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年06月05日 12:56 by ncoghlan, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| new_threading_api.patch | benjamin.peterson, 2008年06月05日 15:12 | |||
| new_threading_api2.patch | benjamin.peterson, 2008年06月05日 15:58 | |||
| new_threading_api3.patch | benjamin.peterson, 2008年06月10日 21:13 | |||
| Messages (8) | |||
|---|---|---|---|
| msg67711 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2008年06月05日 12:55 | |
PEP 371 highlighted the non-PEP 8 compliant nature of the threading API. Since part of that PEP involves updating the multiprocessing API to be PEP 8 compliant before addition the standard library, the threading API should also be updated to be PEP 8 compliant in 3.0. That part's easy - the trickier part if to provide both the existing API and a PEP 8 compliant API in 2.6, with the old names triggering a warning when run with the -3 switch, but not suffering a performance hit otherwise. The trick with that is to define the renamed API's differently depending on whether or not sys.py3kwarning is set, rather than checking it every time the old APIs are invoked. (Left unassigned for the moment, since I'm about to go completely offline for a few days, so it will be tough for me to get to this before the first beta) |
|||
| msg67715 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年06月05日 15:12 | |
Is this what you were looking for? (in the patch) What I did could also be done with metaclasses, but I thought that would be overkill. Warning: this patch causes test threading to crash when run with the -3 flag. |
|||
| msg67717 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年06月05日 15:58 | |
Attaching a patch which fixes everything. |
|||
| msg67743 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2008年06月06日 01:56 | |
The code changes in the patch look pretty good to me (although you probably want to actually use @wraps inside _old_api!) There are obviously also documentation and test suite changes that will be needed. |
|||
| msg67745 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年06月06日 02:03 | |
On Thu, Jun 5, 2008 at 8:56 PM, Nick Coghlan <report@bugs.python.org> wrote: > > Nick Coghlan <ncoghlan@gmail.com> added the comment: > > The code changes in the patch look pretty good to me (although you > probably want to actually use @wraps inside _old_api!) That won't work because we are creating the method than we would pass to wraps. Changing old's __name__ to old_name should do the trick. > > There are obviously also documentation and test suite changes that will > be needed. Of course. I can do that. |
|||
| msg67858 - (view) | Author: Alyssa Coghlan (ncoghlan) * (Python committer) | Date: 2008年06月09日 06:35 | |
I'd still be inclined to put a @wraps(meth) decorator on the definition of the wrapper function (and then override to the supplied name afterwards) - remember that functools.wraps is a decorator factory rather than a decorator itself. That would ensure that any docstrings and the like would be preserved (granted, it appears the threading module currently doesn't *have* any docstrings, but it would still be better to write the wrapping code correctly). |
|||
| msg67923 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年06月10日 21:13 | |
Ok. Pending your acceptance, I'll apply after docs+tests. |
|||
| msg68011 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2008年06月11日 19:45 | |
Applied in r64125, and r64144. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:35 | admin | set | github: 47292 |
| 2008年06月11日 19:45:29 | benjamin.peterson | set | status: open -> closed resolution: fixed messages: + msg68011 |
| 2008年06月10日 21:13:15 | benjamin.peterson | set | files:
+ new_threading_api3.patch messages: + msg67923 |
| 2008年06月09日 06:35:48 | ncoghlan | set | messages: + msg67858 |
| 2008年06月06日 13:09:41 | benjamin.peterson | link | issue3050 dependencies |
| 2008年06月06日 02:28:35 | Rhamphoryncus | set | nosy: + Rhamphoryncus |
| 2008年06月06日 02:03:35 | benjamin.peterson | set | messages: + msg67745 |
| 2008年06月06日 01:56:11 | ncoghlan | set | messages: + msg67743 |
| 2008年06月05日 15:58:37 | benjamin.peterson | set | files:
+ new_threading_api2.patch messages: + msg67717 |
| 2008年06月05日 15:12:18 | benjamin.peterson | set | files:
+ new_threading_api.patch keywords: + patch messages: + msg67715 nosy: + benjamin.peterson |
| 2008年06月05日 12:56:01 | ncoghlan | create | |