diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-09-01 09:16:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-01 09:16:51 (GMT) |
commit | 1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70 (patch) | |
tree | 8db3de2421c1d45d018a7a1dc03f42a0797acee2 /Lib/tkinter | |
parent | 5eca7f3f3836cc734dfe8dc5ec669f3b4e9333fe (diff) | |
download | cpython-1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70.zip cpython-1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70.tar.gz cpython-1f21eaa15e8a0d2b0f78d0e3f2b9e5b458eb0a70.tar.bz2 |
bpo-15999: Clean up of handling boolean arguments. (GH-15610)
* Use the 'p' format unit instead of manually called PyObject_IsTrue().
* Pass boolean value instead 0/1 integers to functions that needs boolean.
* Convert some arguments to boolean only once.
Diffstat (limited to 'Lib/tkinter')
-rw-r--r-- | Lib/tkinter/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index 9258484..5d5cf90 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -2241,7 +2241,7 @@ class Tk(Misc, Wm): _w = '.' def __init__(self, screenName=None, baseName=None, className='Tk', - useTk=1, sync=0, use=None): + useTk=True, sync=False, use=None): """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will be created. BASENAME will be used for the identification of the profile file (see readprofile). @@ -2259,7 +2259,7 @@ class Tk(Misc, Wm): baseName, ext = os.path.splitext(baseName) if ext not in ('.py', '.pyc'): baseName = baseName + ext - interactive = 0 + interactive = False self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) if useTk: self._loadtk() @@ -2361,7 +2361,7 @@ class Tk(Misc, Wm): # copied into the Pack, Place or Grid class. -def Tcl(screenName=None, baseName=None, className='Tk', useTk=0): +def Tcl(screenName=None, baseName=None, className='Tk', useTk=False): return Tk(screenName, baseName, className, useTk) |