ruamel.yaml.RoundTripRepresenter.add_representer(type(None), represent)
作品罰金ruamel.yamlパッケージの0.14.X
バージョンでどのように古いバージョン(バージョン<= 0.11)でrepresenterを使用するruamel.yamlの
古いバージョンで同じ機能を使用する方法(< = 0.11)のruamel.yamlパッケージまたは以前のバージョンのパッケージで使用する代替方法?ここ
は
def represent(self, data):
return self.represent_scalar(u'tag:yaml.org,2002:null', u'NULL')
ruamel.yaml.RoundTripRepresenter.add_representer(type(None), represent)
data = ruamel.yaml.round_trip_load(input.yaml)
ruamel.yaml.round_trip_dump(data, output.yaml)
がmain.py
にRoundTripRepresenter
(representer.py
で定義されて)インポートされなかったruamel.yaml
の古いバージョンではエラー
ruamel.yaml.RoundTripRepresenter.add_representer(type(None), represent_none)\nAttributeError: 'module' object has no attribute 'RoundTripRepresenter'
あなたはruamel.yaml <= 0.11 – Anthon
ruamel.yaml(バージョンを使用したいと思う理由:0.10.11)は、当社でデフォルトパッケージでありますcustom ISO、 –
カスタムISOについてさらに情報を得る可能性はありますか?私のパッケージがどのように/どこで使われているかに関心がありません。 – Anthon