replace has_key with 'in' operator
diff --git a/Lib/lib-tk/FileDialog.py b/Lib/lib-tk/FileDialog.py
index b08d3a8..06ce2b9 100644
--- a/Lib/lib-tk/FileDialog.py
+++ b/Lib/lib-tk/FileDialog.py
@@ -107,7 +107,7 @@
         self.top.bind('<Alt-W>', self.cancel_command)
 
     def go(self, dir_or_file=os.curdir, pattern="*", default="", key=None):
-        if key and dialogstates.has_key(key):
+        if key and key in dialogstates:
             self.directory, pattern = dialogstates[key]
         else:
             dir_or_file = os.path.expanduser(dir_or_file)
diff --git a/Lib/lib-tk/FixTk.py b/Lib/lib-tk/FixTk.py
index cb60b61..638a94c 100644
--- a/Lib/lib-tk/FixTk.py
+++ b/Lib/lib-tk/FixTk.py
@@ -52,7 +52,7 @@
 # if this does not exist, no further search is needed
 if os.path.exists(prefix):
     prefix = convert_path(prefix)
-    if not os.environ.has_key("TCL_LIBRARY"):
+    if "TCL_LIBRARY" not in os.environ:
         for name in os.listdir(prefix):
             if name.startswith("tcl"):
                 tcldir = os.path.join(prefix,name)
@@ -62,13 +62,13 @@
     # as Tcl
     import _tkinter
     ver = str(_tkinter.TCL_VERSION)
-    if not os.environ.has_key("TK_LIBRARY"):
+    if "TK_LIBRARY" not in os.environ:
         v = os.path.join(prefix, 'tk'+ver)
         if os.path.exists(os.path.join(v, "tclIndex")):
             os.environ['TK_LIBRARY'] = v
     # We don't know the Tix version, so we must search the entire
     # directory
-    if not os.environ.has_key("TIX_LIBRARY"):
+    if "TIX_LIBRARY" not in os.environ:
         for name in os.listdir(prefix):
             if name.startswith("tix"):
                 tixdir = os.path.join(prefix,name)
diff --git a/Lib/lib-tk/Tix.py b/Lib/lib-tk/Tix.py
index f1a1091..c81cc83 100755
--- a/Lib/lib-tk/Tix.py
+++ b/Lib/lib-tk/Tix.py
@@ -336,7 +336,7 @@
     # We can even do w.ok.invoke() because w.ok is subclassed from the
     # Button class if you go through the proper constructors
     def __getattr__(self, name):
-        if self.subwidget_list.has_key(name):
+        if name in self.subwidget_list:
             return self.subwidget_list[name]
         raise AttributeError, name
 
@@ -464,9 +464,9 @@
         # also destroys the parent NoteBook thus leading to an exception
         # in Tkinter when it finally calls Tcl to destroy the NoteBook
         for c in self.children.values(): c.destroy()
-        if self.master.children.has_key(self._name):
+        if self._name in self.master.children:
             del self.master.children[self._name]
-        if self.master.subwidget_list.has_key(self._name):
+        if self._name in self.master.subwidget_list:
             del self.master.subwidget_list[self._name]
         if self.destroy_physically:
             # This is bypassed only for a few widgets
@@ -488,8 +488,8 @@
 
     def __init__(self, itemtype, cnf={}, **kw):
         master = _default_root              # global from Tkinter
-        if not master and cnf.has_key('refwindow'): master=cnf['refwindow']
-        elif not master and kw.has_key('refwindow'):  master= kw['refwindow']
+        if not master and 'refwindow' in cnf: master=cnf['refwindow']
+        elif not master and 'refwindow' in kw:  master= kw['refwindow']
         elif not master: raise RuntimeError, "Too early to create display style: no root window"
         self.tk = master.tk
         self.stylename = self.tk.call('tixDisplayStyle', itemtype,
@@ -571,7 +571,7 @@
         return btn
 
     def invoke(self, name):
-        if self.subwidget_list.has_key(name):
+        if name in self.subwidget_list:
             self.tk.call(self._w, 'invoke', name)
 
 class ComboBox(TixWidget):
@@ -1433,7 +1433,7 @@
         self.subwidget_list['help'] = _dummyButton(self, 'help')
 
     def invoke(self, name):
-        if self.subwidget_list.has_key(name):
+        if name in self.subwidget_list:
             self.tk.call(self._w, 'invoke', name)
 
 class TList(TixWidget, XView, YView):
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index 4dcb256..1516d79 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -547,7 +547,7 @@
 
         A widget specified for the optional displayof keyword
         argument specifies the target display."""
-        if not kw.has_key('displayof'): kw['displayof'] = self._w
+        if 'displayof' not in kw: kw['displayof'] = self._w
         self.tk.call(('clipboard', 'clear') + self._options(kw))
     def clipboard_append(self, string, **kw):
         """Append STRING to the Tk clipboard.
@@ -555,7 +555,7 @@
         A widget specified at the optional displayof keyword
         argument specifies the target display. The clipboard
         can be retrieved with selection_get."""
-        if not kw.has_key('displayof'): kw['displayof'] = self._w
+        if 'displayof' not in kw: kw['displayof'] = self._w
         self.tk.call(('clipboard', 'append') + self._options(kw)
               + ('--', string))
     # XXX grab current w/o window argument
@@ -613,7 +613,7 @@
         self.tk.call('option', 'readfile', fileName, priority)
     def selection_clear(self, **kw):
         """Clear the current X selection."""
-        if not kw.has_key('displayof'): kw['displayof'] = self._w
+        if 'displayof' not in kw: kw['displayof'] = self._w
         self.tk.call(('selection', 'clear') + self._options(kw))
     def selection_get(self, **kw):
         """Return the contents of the current X selection.
@@ -622,7 +622,7 @@
         the selection and defaults to PRIMARY.  A keyword
         parameter displayof specifies a widget on the display
         to use."""
-        if not kw.has_key('displayof'): kw['displayof'] = self._w
+        if 'displayof' not in kw: kw['displayof'] = self._w
         return self.tk.call(('selection', 'get') + self._options(kw))
     def selection_handle(self, command, **kw):
         """Specify a function COMMAND to call if the X
@@ -653,7 +653,7 @@
         be provided:
         selection - name of the selection (default PRIMARY),
         type - type of the selection (e.g. STRING, FILE_NAME)."""
-        if not kw.has_key('displayof'): kw['displayof'] = self._w
+        if 'displayof' not in kw: kw['displayof'] = self._w
         name = self.tk.call(('selection', 'own') + self._options(kw))
         if not name: return None
         return self._nametowidget(name)
@@ -1735,7 +1735,7 @@
         the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if
         such a file exists in the home directory."""
         import os
-        if os.environ.has_key('HOME'): home = os.environ['HOME']
+        if 'HOME' in os.environ: home = os.environ['HOME']
         else: home = os.curdir
         class_tcl = os.path.join(home, '.%s.tcl' % className)
         class_py = os.path.join(home, '.%s.py' % className)
@@ -1942,7 +1942,7 @@
         self.master = master
         self.tk = master.tk
         name = None
-        if cnf.has_key('name'):
+        if 'name' in cnf:
             name = cnf['name']
             del cnf['name']
         if not name:
@@ -1953,7 +1953,7 @@
         else:
             self._w = master._w + '.' + name
         self.children = {}
-        if self.master.children.has_key(self._name):
+        if self._name in self.master.children:
             self.master.children[self._name].destroy()
         self.master.children[self._name] = self
     def __init__(self, master, widgetName, cnf={}, kw={}, extra=()):
@@ -1978,7 +1978,7 @@
         """Destroy this and all descendants widgets."""
         for c in self.children.values(): c.destroy()
         self.tk.call('destroy', self._w)
-        if self.master.children.has_key(self._name):
+        if self._name in self.master.children:
             del self.master.children[self._name]
         Misc.destroy(self)
     def _do(self, name, args=()):
@@ -2006,7 +2006,7 @@
         extra = ()
         for wmkey in ['screen', 'class_', 'class', 'visual',
                   'colormap']:
-            if cnf.has_key(wmkey):
+            if wmkey in cnf:
                 val = cnf[wmkey]
                 # TBD: a hack needed because some keys
                 # are not valid as keyword arguments
@@ -2444,10 +2444,10 @@
         highlightcolor, highlightthickness, relief, takefocus, visual, width."""
         cnf = _cnfmerge((cnf, kw))
         extra = ()
-        if cnf.has_key('class_'):
+        if 'class_' in cnf:
             extra = ('-class', cnf['class_'])
             del cnf['class_']
-        elif cnf.has_key('class'):
+        elif 'class' in cnf:
             extra = ('-class', cnf['class'])
             del cnf['class']
         Widget.__init__(self, master, 'frame', cnf, {}, extra)
@@ -3153,7 +3153,7 @@
         self.menuname = menu._w
         # 'command' is the only supported keyword
         callback = kwargs.get('command')
-        if kwargs.has_key('command'):
+        if 'command' in kwargs:
             del kwargs['command']
         if kwargs:
             raise TclError, 'unknown option -'+kwargs.keys()[0]
diff --git a/Lib/lib-tk/tkSimpleDialog.py b/Lib/lib-tk/tkSimpleDialog.py
index 8c583db..24388a5 100644
--- a/Lib/lib-tk/tkSimpleDialog.py
+++ b/Lib/lib-tk/tkSimpleDialog.py
@@ -283,7 +283,7 @@
 
 class _QueryString(_QueryDialog):
     def __init__(self, *args, **kw):
-        if kw.has_key("show"):
+        if "show" in kw:
             self.__show = kw["show"]
             del kw["show"]
         else:
diff --git a/Lib/lib-tk/turtle.py b/Lib/lib-tk/turtle.py
index 625b31b..afe5658 100644
--- a/Lib/lib-tk/turtle.py
+++ b/Lib/lib-tk/turtle.py
@@ -335,10 +335,10 @@
         if ex[:1] == '_' or ex[-1:] == '_':
             del _dict[ex]
     for ex in exclude:
-        if _dict.has_key(ex):
+        if ex in _dict:
             del _dict[ex]
     for ex in __methods(fromClass):
-        if _dict.has_key(ex):
+        if ex in _dict:
             del _dict[ex]
 
     for method, func in _dict.items():