We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'tag:yaml.org,2002:merge'
Here is the code to reproduce.
# Ref: https://github.com/marcy-terui/lamvery/blob/master/lamvery/config.py#L28-L30 import yaml y = """ def: &default foo: bar pro: <<: *default """ yaml.load(y) #=> {'def': {'foo': 'bar'}, 'pro': {'foo': 'bar'}} from collections import OrderedDict yaml.add_constructor( yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, lambda loader, node: OrderedDict(loader.construct_pairs(node))) yaml.load(y) # => ConstructorError: could not determine a constructor for the tag 'tag:yaml.org,2002:merge' in "<string>", line 6, column 3: <<: *default ^
The text was updated successfully, but these errors were encountered:
サンプルのdice_constructorだとこう言うコケ方にならない、なんでだろう?
dice_constructor
http://pyyaml.org/wiki/PyYAMLDocumentation#Constructorsrepresentersresolvers
Sorry, something went wrong.
根深そうな問題ですね・・・。順番を保持するためにYAMLでOrderdDictを扱うために入っているコードなんですが、yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG == tag:yaml.org,2002:map なので、tag:yaml.org,2002:merge を足してみたりしたら別のエラーになったり・・・wちょっと調査と試行錯誤が必要そうです。。。
yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG
tag:yaml.org,2002:map
tag:yaml.org,2002:merge
No branches or pull requests
Here is the code to reproduce.
The text was updated successfully, but these errors were encountered: