Skip to content
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

@hjoukl
Copy link
Contributor

@hjoukl 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.

Use repr() instead of str()/unicode() as 'stringification' function in the
FloatElement type registration.
@scoder
Copy link
Member

@scoder 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
Copy link
Contributor Author

@hjoukl hjoukl commented Apr 8, 2016

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

@scoder
Copy link
Member

@scoder scoder commented Apr 8, 2016

Thanks!

@scoder scoder merged commit 85a5d43 into lxml:master Apr 8, 2016
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants