self.object.update(version=attrs.get("version"), generator=attrs.get("generator"))
elif name == "relation":
print(name, dict(attrs))
elif name in ("node", "way"):
node = dict(type=name, nodes=[], **attrs)
After Change
def startElement(self, name, attrs):
if name == "osm":
self.object.update({k: attrs[k] for k in attrs.keys()
if k in ("version", "generator")})
elif name in ("node", "way"):
self._element = dict(type=name, tags={}, nodes=[], **attrs)