Skip to content
Snippets Groups Projects
Commit 4b97edde authored by Liorithiel's avatar Liorithiel
Browse files

Comparing types: type(x)==type(self) => isinstance(x, self.__class__)

parent 175a792c
No related branches found
No related tags found
No related merge requests found
......@@ -74,9 +74,9 @@ def __init__(self, tag=None, attrs={}, payload=[], parent=None, node=None):
if self.parent and not self.namespace: self.namespace=self.parent.namespace
for attr in attrs.keys():
self.attrs[attr]=attrs[attr]
if type(payload) in (type(''),type(u'')): payload=[payload]
if isinstance(payload, basestring)
for i in payload:
if type(i)==type(self): self.addChild(node=i)
if isinstance(i, Node): self.addChild(node=i)
else: self.data.append(ustr(i))
def __str__(self,fancy=0):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment