|
From: Ingy d. N. <in...@in...> - 2016-04-03 01:11:21
|
The python one is 1*60^3+2*60^2+3*60^1+4*60^0. Not sure about the Ruby one. Perl would be the string '1:2:3:4'. Welcome to the sexagesimal debacle of YAML implicit typing. Specifically: [-+]?[1-9][0-9_]*(:[0-5]?[0-9])+ *# (base 60)* Back in 2005ish we made up a bunch of types that unquoted scalars should be cast to: http://yaml.org/type/ Later we (yaml core) decided that the default type resolution should match JSON, but we never took down the type info. This has led to much bugginess in scalar typing. Hopefully we can get schema related guidelines locked down in YAML 1.3. On Fri, Apr 1, 2016 at 10:38 AM, Aimon Bustardo <me...@ai...> wrote: > Hi, I am trying to figure out an oddity (at least to me) in YAML. Why is > foo: 1:2:3:4 seen as an integer and what is it doing to calculate? It is > different between languages as seen below: > > Ruby: > irb(main):003:0> YAML.load('foo: 1:2:3:4') > => {"foo"=>3963} > > Python: > >>> print yaml.load('foo: 1:2:3:4') > >>> {'foo': 223384} > > > Thanks. > > > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140 > _______________________________________________ > Yaml-core mailing list > Yam...@li... > https://lists.sourceforge.net/lists/listinfo/yaml-core > |