jeetsukumaran / DendroPy

A Python library for phylogenetic scripting, simulation, data processing and manipulation.
https://pypi.org/project/DendroPy/.
BSD 3-Clause "New" or "Revised" License
210 stars 61 forks source link

char. matrix `from_dict` and unicode keys #42

Closed mtholder closed 8 years ago

mtholder commented 8 years ago

If the taxon labels are unicode, then (in python 2) from_dict will fail because there is a special case:

if isinstance(x, str):

logic. We should probably have a string utility function. peyotl uses an is_str_type method for this. See https://github.com/mtholder/peyotl/blob/c3a544211edc669e664bae28095d52cecfa004f3/peyotl/utility/str_util.py#L5-L25 to deal with the py2 + py3 differences.

All cases of isinstance(..., str) should probably be checked.

Not a high priority (for me at least)

jeetsukumaran commented 8 years ago

Thanks. Fixed in: 7f28aca.