Custom Query (121 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (49 - 51 of 121)

Ticket Resolution Summary Owner Reporter
#30 fixed Timestamp support has floating-point roundoff xi edemaine@…

Reported by edemaine@…, 8 years ago.

Description

Example:

>>> import yaml, datetime
>>> yaml.dump(datetime.datetime(2005, 7, 8, 17, 35, 4, 517600))
'2005-07-08 17:35:04.517600\n'
>>> yaml.load(_)
datetime.datetime(2005, 7, 8, 17, 35, 4, 517599)

This breaks the desired rule that yaml.load(yaml.dump(x)) == x in a case where there should be no roundoff. (datetime.datetime uses integers everywhere to avoid any error.)

The offending code seems to be line 321 in yaml/constructor.py:

fraction = int(float(values['fraction'])*1000000)

This seems to be an "easy" way to convert the trailing '.517600' into an integer, but it can go beyond floating-point precision. Wouldn't the following work?

fraction = int(values['fraction'][:6].ljust(6, '0'))
#31 fixed PyYAML for Python 2.5 xi edemaine@…

Reported by edemaine@…, 8 years ago.

Description

Could you compile a Windows binary of PyYAML for Python 2.5 (released fairly recently)? Ideally with libyaml support built in...

#33 fixed PyYAML + libyyaml shouldn't need PyRex xi edemaine@…

Reported by edemaine@…, 8 years ago.

Description

In my understanding of PyRex? (which, I admit, is fairly limited), it is a tool that converts PyRex? code into C (.c, .h, etc.) and Python code. Can't this conversion be done ahead of time when assembling a distribution, so that you don't need PyRex? on the install side? (Same as running lex or yacc etc. at distribution time instead of install time.) Or is there something more subtle going on during installation that this is actually necessary?

Reducing the barrier to installation should make the "fast PyYAML solution" (PyYAML + libyaml) more widely available.

Note: See TracQuery for help on using queries.