X Tutup
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/matplotlib/backends/backend_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def __flush(self, indent=True):
self.__write(_escape_cdata(data))
self.__data = []

def start(self, tag, attrib={}, **extra):
def start(self, tag, attrib=None, **extra):
"""
Open a new element. Attributes can be given as keyword
arguments, or as a string/string dictionary. The method returns
Expand All @@ -152,6 +152,8 @@ def start(self, tag, attrib={}, **extra):
-------
An element identifier.
"""
if attrib is None:
attrib = {}
self.__flush()
tag = _escape_cdata(tag)
self.__data = []
Expand Down Expand Up @@ -232,12 +234,14 @@ def close(self, id):
while len(self.__tags) > id:
self.end()

def element(self, tag, text=None, attrib={}, **extra):
def element(self, tag, text=None, attrib=None, **extra):
"""
Add an entire element. This is the same as calling :meth:`start`,
:meth:`data`, and :meth:`end` in sequence. The *text* argument can be
omitted.
"""
if attrib is None:
attrib = {}
self.start(tag, attrib, **extra)
if text:
self.data(text)
Expand Down
Loading
X Tutup