matplotlib/matplotlib — pull request #1840 by ajdawson (2013-03-21 13:58:41+00:00)
Title: BF - prevent a TypeError for lists of vertices in set_marker

The documentation for setting markers (http://matplotlib.org/api/artist_api.html#matplotlib.lines.Line2D.set_marker) suggests that:

> a list of (x, y) pairs used for Path vertices

is an acceptable input. However, if one tries to use a Python list a TypeError is returned. This is because the `set_marker` code attempts to use the marker specification as the key in a dictionary, which fails because lists are not hashable. To avoid this I added an extra condition to the logic that makes sure the input is not a list before attempting to use it as a dictionary key (taking advantage of lazily evaluated boolean conditions). This allows the final conditional to be executed which happily constructs a path from a list of vertices, just as it does from a tuple of vertices.