There is something strange going on, or you are not using the code example to load that file and then get that print from data. If you are really using yaml.load_all that will give you back a generator object which allows you to step over the 1 or more YAML document in that file. Since you're not using document directive markers, it makes little sense to use load_all():
from __future__ import print_function
import ruamel.yaml as yaml
datas = yaml.load_all(open('testingyaml.yaml'), Loader=yaml.RoundTripLoader)
print(datas, '\n', '-' * 50, sep='')
for data in datas:
print(data['spring']['profiles'])
print(type(data))
gives:
dev
The actual type of data in the above example is a ruamel.yaml.comments.CommentedMap which is also what you would get if you did the simpler:
data = yaml.load(open('testingyaml.yaml'), Loader=yaml.RoundTripLoader)
print(type(data))
which prints <class 'ruamel.yaml.comments.CommentedMap'> (not the use of load() instead of loadall().
The CommentedMap is derived from ordereddict
from ruamel.yaml.compat import ordereddict
from ruamel.yaml.comments import CommentedMap
assert issubclass(CommentedMap, ordereddict)
because for roundtripping (you are using the RoundTripLoader) ruamel.yaml needs to preserve the order and have a place to attach any comments and other informations to preserve, which is not possible when using dict. ordereddict is a just a convenience class around ruamel.ordereddict (if available) or OrderedDict ¹.
You can of course import ordereddict yourself as above and use it, but if you don't need roundtripping nor preservation of order in your dictionaries (i.e. are fine with dict) just use the standard loader:
data = yaml.load(open('testingyaml.yaml'))
print(type(data))
prints:
<type 'dict'>
I recommend not to "downgrade" by using PyYAML: it only implements the old 1.1 version of YAML, and although ruamel.yaml is a derivative of PyYAML, since it was derived, it has quite a few issues solved that originally wer filed against, and still pertain to, PyYAML ².
¹ ruamel.ordereddict is a (fast) C implementation of ordered dicts that existed already for a few years before OrderedDict appeared in the standard library, as the standard library version has a small subset of functionality, and until Python 3.5 was (slow) pure Python, switching to OrderedDict was never really an option for me.
² But then I am biased as I am the author of ruamel.yaml (and know that it needs more documentation).
type(data)? My guess is that pyYaml is using some dictionary type of its own, notcollections.OrderedDict.pyyaml, orruamel.yaml?