Closed embray closed 7 years ago
Good catch! Now I'm thinking we don't need to do a full isinstance
check (we don't care about things like https://docs.python.org/3/reference/datamodel.html?highlight=__instancecheck__#class.__instancecheck__) since a "fake instance" won't have the right memory layout anyway ...
I was thinking that too over lunch (it was a very lonely lunch :)
Would you like me to update it to just remove the full PyObject_IsInstance
?
Yes, lets try it.
Also, update CHANGELOG/AUTHORS.rst.
Done--I agree it makes sense to submit the change upstream to wrapt as well.
Merging #18 into master will decrease coverage by
0.59%
. The diff coverage isn/a
.
@@ Coverage Diff @@
## master #18 +/- ##
=========================================
- Coverage 93.81% 93.22% -0.6%
=========================================
Files 8 7 -1
Lines 2038 1594 -444
Branches 245 245
=========================================
- Hits 1912 1486 -426
+ Misses 101 83 -18
Partials 25 25
Impacted Files | Coverage Δ | |
---|---|---|
src/lazy_object_proxy/__init__.py | 85.71% <0%> (-14.29%) |
:arrow_down: |
tests/test_lazy_object_proxy.py | 92.11% <0%> (-0.44%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 7033131...cb8ad7b. Read the comment docs.
Allright, thanks!
Thanks to you too!
Published 1.3.0
on PyPI.
Arithmetic operations on subclasses of
Proxy
(specifically the C implementation) are slower (roughly three times) due to inexact match in thePyObject_Instance
call inProxy__WRAPPED_REPLACE_OR_RETURN_NULL
. For simple C-level type compatibility checkingPyObject_TypeCheck
is much faster. In fact thePyObject_IsInstance
is probably superfluous with this but I left it anyways.Before:
After: