nipy / PySurfer

Cortical neuroimaging visualization in Python
https://pysurfer.github.io/
BSD 3-Clause "New" or "Revised" License
240 stars 97 forks source link

Colormap as list tweaks #203

Closed christianbrodbeck closed 7 years ago

christianbrodbeck commented 7 years ago
larsoner commented 7 years ago

LGTM, @mwaskom do you want to look since this touches some code you modified last week?

mwaskom commented 7 years ago

Seems fine; I assume that the behavior of checking against collections.Sequence is invariant across Python 2/3?

Given the already confusing difference between in how we handle arrays/lists it felt a little cleaner to be strict that the list behavior applies explicitly to lists and not "list-like things", but I guess I don't have a problem accepting tuples.

christianbrodbeck commented 7 years ago

I'm not aware of any relevant changes (Python docs). If you want to be more conservative we could use (list, tuple) in the type check, but I think Sequence would be appropriate for Python duck typing.