➜

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.

classification
标题: Derby: Convert the _tkinter module to use Argument Clinic
类型: enhancement Stage: resolved
Components: Argument Clinic, Extension Modules, Tkinter Versions: Python 3.5
process
状态: closed Resolution: fixed
Dependencies: 20196 后续:
分配给: serhiy.storchaka 抄送列表: gpolo, jkloth, larry, python-dev, serhiy.storchaka, steve.dower
优先级: normal 关键字: patch

Created on 2014-01-07 21:03 by serhiy.storchaka, last changed 2022-04-11 14:57 by admin. This issue is now closed.

文件
文件名 上传时间 Description 编辑
tkinter_clinic.patch serhiy.storchaka, 2014-01-18 12:26 review
tkinter_clinic_2.patch serhiy.storchaka, 2014-03-20 18:45 review
tkinter_clinic_3.patch serhiy.storchaka, 2014-06-01 15:47 review
tkinter_clinic_4.patch serhiy.storchaka, 2015-04-17 20:01 review
larry.fix.tkinter.build.on.windows.diff.1.txt larry, 2015-05-03 19:58 review
Messages (18)
msg207600 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-01-07 21:03
In progress. Actually many functions are not very suitable for Argument Clinic.
msg207604 - (view) Author: Larry Hastings (larry) * (Python committer) 日期: 2014-01-07 21:35
What functions, and what makes them unsuitable?
msg207605 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-01-07 21:58
call() just converts all args to Tcl list. Is Argument Clinic supports *args 
and **kwargs? I'm not sure there is a benefit with using Argument Clinic here.

splitlist() and split() first call PyArg_ParseTuple with one argument, check 
the input, and then may call PyArg_ParseTuple with other argument. They need 
large refactoring to use Argument Clinic.

getint(), getdouble(), getboolean() first manually unpack arguments tuple, and 
then may call PyArg_ParseTuple. Same as above.

setvar()/globalsetvar(), getvar()/globalgetvar(), unsetvar()/globalunsetvar() 
shares common code parametrized by flags. I think this is resolvable. But 
worse, they can delegates their execution to other thread and should save all 
arguments in events queue. And this looks absolutely unsuitable for Argument 
Clinic.
msg207609 - (view) Author: Larry Hastings (larry) * (Python committer) 日期: 2014-01-07 22:11
(It would have made it easier on me if you'd used the C function names, instead of the names in the module.)

I agree.  In retrospect, it's not surprising that things in _tkinter aren't suitable, as it appears to be a shunt for calling things in Tcl.

For what it's worth, Argument Clinic is only intended for functions that use PyArg_ParseTuple or PyArg_ParseTupleOrKeywords to parse their arguments.  So something like call is and will forever be unsuitable.

(And reading _tkinter.c this has reminded me why I don't like Tcl ;-)
msg207699 - (view) Author: Larry Hastings (larry) * (Python committer) 日期: 2014-01-08 20:43
So do you think there are any entry points worth converting in _tkinter, or should we close this issue?
msg207706 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-01-08 22:00
You misunderstood me. I already have 1018-lines patch which converts about 24 
functions and methods to Argument Clinic church. And I'm working on left 
functions. Do you want to get unfinished patch?
msg207716 - (view) Author: Larry Hastings (larry) * (Python committer) 日期: 2014-01-08 23:58
Oh, okay.  That sounds fine, and I'm not in a hurry.  Please post the patch whenever you're ready, thanks!
msg208398 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-01-18 12:26
Here is a patch.
msg214259 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-03-20 18:45
Here is updated patch.
msg219507 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2014-06-01 15:47
Synchronized with tip.
msg241357 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2015-04-17 19:59
Updated to the tip. Converted methods getint, getdouble, getboolean, splitlist, split.
msg242471 - (view) Author: Roundup Robot (python-dev) (Python triager) 日期: 2015-05-03 13:18
New changeset b22ced894d51 by Serhiy Storchaka in branch 'default':
Issue #20168: Converted the _tkinter module to Argument Clinic.
https://hg.python.org/cpython/rev/b22ced894d51
msg242478 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) 日期: 2015-05-03 14:31
wantobjects() was not converted due to a bug in Argument Clinic (issue24051).
msg242503 - (view) Author: Steve Dower (steve.dower) * (Python committer) 日期: 2015-05-03 19:39
This broke Windows builds because of unnecessary "static" qualifiers on the forward declarations at lines 2685 and 3006 (as discussed on #20323).

Removing "static" from these lines fixes the build.
msg242507 - (view) Author: Larry Hastings (larry) * (Python committer) 日期: 2015-05-03 19:58
As mentioned on #20148, removing the "static" from the forward declarations breaks it on GCC.  (And, of the two, I think GCC is the one being reasonable here.)

Attached is a patch that should fix the build for tkinter.
msg242528 - (view) Author: Steve Dower (steve.dower) * (Python committer) 日期: 2015-05-03 21:43
LGTM
msg242530 - (view) Author: Roundup Robot (python-dev) (Python triager) 日期: 2015-05-03 21:49
New changeset 7a76c462c7f6 by Larry Hastings in branch 'default':
Fix Windows build breakage from checkins on Issues #20148 and #20168.
https://hg.python.org/cpython/rev/7a76c462c7f6
msg242533 - (view) Author: Larry Hastings (larry) * (Python committer) 日期: 2015-05-03 21:53
Steve, please close this issue when you've confirmed it's now building correctly on Windows.
历史
日期 用户 动作 参数
2022-04-11 14:57:56admin修改github: 64367
2015-05-04 12:47:16serhiy.storchaka修改状态: open -> closed
resolution: fixed
2015-05-03 21:53:59larry修改消息: + msg242533
2015-05-03 21:49:51python-dev修改消息: + msg242530
2015-05-03 21:43:57steve.dower修改消息: + msg242528
2015-05-03 19:58:51larry修改文件: + larry.fix.tkinter.build.on.windows.diff.1.txt

消息: + msg242507
2015-05-03 19:39:35steve.dower修改状态: closed -> open

抄送: + steve.dower
消息: + msg242503

resolution: fixed -> (no value)
2015-05-03 14:31:49serhiy.storchaka修改状态: open -> closed
消息: + msg242478

dependencies: - Argument Clinic no longer works with single optional argument
resolution: fixed
stage: patch review -> resolved
2015-05-03 13:18:49python-dev修改抄送: + python-dev
消息: + msg242471
2015-04-24 13:49:13serhiy.storchaka修改dependencies: + Argument Clinic no longer works with single optional argument
2015-04-17 20:01:18serhiy.storchaka修改文件: + tkinter_clinic_4.patch
2015-04-17 20:01:06serhiy.storchaka修改文件: - tkinter_4.patch
2015-04-17 19:59:59serhiy.storchaka修改文件: + tkinter_4.patch

消息: + msg241357
2015-02-25 15:26:31serhiy.storchaka修改components: + Argument Clinic
2014-06-01 15:47:18serhiy.storchaka修改文件: + tkinter_clinic_3.patch

消息: + msg219507
2014-03-20 18:45:13serhiy.storchaka修改文件: + tkinter_clinic_2.patch

消息: + msg214259
versions: + Python 3.5, - Python 3.4
2014-01-18 12:26:29serhiy.storchaka修改文件: + tkinter_clinic.patch

抄送: + gpolo
消息: + msg208398

keywords: + patch
stage: patch review
2014-01-09 07:28:42serhiy.storchaka修改dependencies: + Argument Clinic generates invalid code for optional parameter
2014-01-08 23:58:16larry修改消息: + msg207716
2014-01-08 22:00:25serhiy.storchaka修改消息: + msg207706
2014-01-08 20:43:48larry修改消息: + msg207699
2014-01-08 01:36:37r.david.murray链接issue20187 dependencies
2014-01-07 22:11:15larry修改消息: + msg207609
2014-01-07 21:58:06serhiy.storchaka修改消息: + msg207605
2014-01-07 21:35:33larry修改消息: + msg207604
2014-01-07 21:09:23jkloth修改抄送: + jkloth
2014-01-07 21:04:21serhiy.storchaka修改assignee: serhiy.storchaka

抄送: + larry
2014-01-07 21:03:59serhiy.storchaka创建