mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
replace has_key with 'in' operator
This commit is contained in:
parent
de0559998f
commit
6e3dbbdf39
29 changed files with 71 additions and 71 deletions
|
@ -91,7 +91,7 @@ class DOMBuilder:
|
|||
|
||||
def canSetFeature(self, name, state):
|
||||
key = (_name_xform(name), state and 1 or 0)
|
||||
return self._settings.has_key(key)
|
||||
return key in self._settings
|
||||
|
||||
# This dictionary maps from (feature,value) to a list of
|
||||
# (option,value) pairs that should be set on the Options object.
|
||||
|
@ -247,7 +247,7 @@ class DOMEntityResolver(object):
|
|||
|
||||
def _guess_media_encoding(self, source):
|
||||
info = source.byteStream.info()
|
||||
if info.has_key("Content-Type"):
|
||||
if "Content-Type" in info:
|
||||
for param in info.getplist():
|
||||
if param.startswith("charset="):
|
||||
return param.split("=", 1)[1].lower()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue