Re: Type as Value

Kirill Simonov <[email protected]>
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
James Stroud wrote:
> Hello All,
> 
> Thank you for the quick response to my previous question.
> 
> I have another that I can't find the answer to. I want to make a yaml 
> mapping value that evaluates to a type. For example, in python, the 
> result would be
> 
>    {'atype' : int}
> 
> Tags do not seem to be able to represent values on their own but only 
> indicate how a the yaml value will be evaluated. In essence, what is the 
> equivalent to a type tag for yaml?
> 
>    atype : !!type int
> 

If you are using PyYAML, you can write

     { atype: !!python/name:int }

It's Python-specific though.

Thanks,
Kirill

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.