yamlを辞書のようではなくクラスのように
アクセスしたいのですが、可能でしょうか?

■test.yml
a:
- test
- test2
x: y

■スクリプト
import yaml
f = open('test.yml','r')
data = yaml.load(f)

data['x'] #'y'
data.x #'y' このようにできますか?