Xiaokang
Xiaokang

Reputation: 331

How to express sequence of numbers in yaml

Is there any method to express a sequence of numbers in YAML?

To get a sequence from 1 to 100, I can use list(range(1,101)) in Python, or seq(1,100) in R. But do we have any similar way for YAML file?

Upvotes: 3

Views: 1961

Answers (1)

Anthon
Anthon

Reputation: 76672

No you cannot, there is no such provision in any of the YAML specifications.

Of course the program that interprets the YAML file could create an object for the tag !range and substitute its nodes with a range:

abc: !range 
- 0
- 100

but that is at the application level, and YAML doesn't know anything about it.

Upvotes: 1

Related Questions