DEPS: drop py2 from test and doc, remove compat #594#629
DEPS: drop py2 from test and doc, remove compat #594#629skirpichev merged 32 commits intompmath:masterfrom
Conversation
|
Let's not just drop tests without fixing the code. % |
|
@fangchenli, unfortunately, there are test failures (mostly/all? related to range function vs kwarg conflict), please fix this. |
skirpichev
left a comment
There was a problem hiding this comment.
Looks fine, except for comments above.
|
Hold on; this patch contains does a bunch of stuff beyond compatibility fixes, changing code like into in performance-critical places (arithmetic operations). The |
|
% % |
|
OK, but in the original code Anyway, what you'd need to profile is actual mpmath code, not the atomic Python operations. |
5000000 loops, best of 5: 91.5 nsec per loop # Python 3.7
|
|
Timing some mixed mpf arithmetic operations, there doesn't seem to be any measurable impact on performance anymore. So I'll withdraw my objection, considering that the new version of the code is simpler / more idiomatic. |
|
@fredrik-johansson, from simple benchmarks it looks like isinstance() calls slightly slower: The other point is that this change is totally unrelated to the subject of this pr (which is big enough). There is nothing wrong with the old code from the py3 point of view, so I would suggest to revert that part. |
|
mpmath/libmp/libmpf.py, mpmath/ctx_mp.py, mpmath/matrices/matrices.py and mpmath/tests/test_matrices.py still have workarounds for py2 (or py3<3.5). Try grep:) |
cclauss
left a comment
There was a problem hiding this comment.
LGTM Let's drop the legacy!!!
cbm755
left a comment
There was a problem hiding this comment.
This looks great to me! I made a few comments above, only one of any consequence (the dropping of a finally: ctx.prec = prec) block.
Co-authored-by: Sergey B Kirpichev <[email protected]>
|
@cbm755, thanks! Lets merge this tomorrow. |
|
@fangchenli, thanks |
close #594