Yaml loading accepts bytes and unicode, either directly or via IO. For python 3, bytes and str work fine, but for Python 2 code this is redundant and limited. Text instead of str should make type checks more accurate.