summaryrefslogtreecommitdiff
path: root/bs4/element.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2013-05-15 11:10:12 -0400
committerLeonard Richardson <leonard.richardson@canonical.com>2013-05-15 11:10:12 -0400
commit87c7f93d7feb8bd982dbbc42d814352b60be344d (patch)
tree3905df101f631ca66055ab2af50c36d34227268b /bs4/element.py
parentada530f6bc24bf4e536c1c859d798b836ec0799c (diff)
parentc3cc17f0dda7d378890a12fd8b5c29de9f923dab (diff)
Merge.
Diffstat (limited to 'bs4/element.py')
-rw-r--r--bs4/element.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/bs4/element.py b/bs4/element.py
index 1f121f4..f6864f2 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -1392,10 +1392,13 @@ class Tag(PageElement):
def recursiveChildGenerator(self):
return self.descendants
- # This was kind of misleading because has_key() (attributes) was
- # different from __in__ (contents). has_key() is gone in Python 3,
- # anyway.
- has_key = has_attr
+ def has_key(self, key):
+ """This was kind of misleading because has_key() (attributes)
+ was different from __in__ (contents). has_key() is gone in
+ Python 3, anyway."""
+ warnings.warn('has_key is deprecated. Use has_attr("%s") instead.' % (
+ key))
+ return self.has_attr(key)
# Next, a couple classes to represent queries and their results.
class SoupStrainer(object):