Skip to content

Commit 15b23de

Browse files
author
Arzaroth Lekva
committed
contains
1 parent 7518606 commit 15b23de

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rapidxml/rapidxml.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ def __getitem__(self, name):
5252
raise KeyError(name)
5353
return res
5454

55+
def __contains__(self, name):
56+
try:
57+
self[name]
58+
except:
59+
return False
60+
return True
61+
5562
class RapidXml(DictNode, _rapidxml.Document):
5663
def __init__(self,
5764
text="",

0 commit comments

Comments
 (0)