New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix losing float precision for lxml.objectify FloatElement. #191

Merged
merged 2 commits into from Apr 8, 2016

Conversation

Projects
None yet
2 participants
@hjoukl
Contributor

hjoukl commented Apr 8, 2016

Use repr() instead of str()/unicode() as 'stringification' function in the
FloatElement type registration.

This fixes LP:#1567505.

One of the new test methods doesn't fail when running the updated test suite without the fix (test_type_float_instantiation_precision) applied. This is intentional, creating a FloatElement from a string never lost precision. The test is in for completeness' sake.

Fix losing float precision for lxml.objectify FloatElement.
Use repr() instead of str()/unicode() as 'stringification' function in the
FloatElement type registration.
@scoder

This comment has been minimized.

Show comment
Hide comment
@scoder

scoder Apr 8, 2016

Member

One of the doctests is now failing in Py2.6, which doesn't have the improved repr() implementation for floats. I'd rather change the test than the implementation, though.

Member

scoder commented Apr 8, 2016

One of the doctests is now failing in Py2.6, which doesn't have the improved repr() implementation for floats. I'd rather change the test than the implementation, though.

@hjoukl

This comment has been minimized.

Show comment
Hide comment
@hjoukl

hjoukl Apr 8, 2016

Contributor

Done. Should've probably enabled travis for my fork...

Contributor

hjoukl commented Apr 8, 2016

Done. Should've probably enabled travis for my fork...

@scoder

This comment has been minimized.

Show comment
Hide comment
@scoder

scoder Apr 8, 2016

Member

Thanks!

Member

scoder commented Apr 8, 2016

Thanks!

@scoder scoder merged commit 85a5d43 into lxml:master Apr 8, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment