Closed huzecong closed 3 years ago
Merging #15 (606a5f3) into master (cffb262) will increase coverage by
0.72%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #15 +/- ##
==========================================
+ Coverage 97.66% 98.38% +0.72%
==========================================
Files 7 7
Lines 299 309 +10
==========================================
+ Hits 292 304 +12
+ Misses 7 5 -2
Thank you! released 0.4.5 with this change: https://pypi.org/project/wirerope/0.4.5/
This PR fixes issue #14: it adds support for calling
super()
forWireRope
-decorated descriptors.This is done by defining
__set_name__
on the descriptor mixins. During class construction, for each descriptor defined in the class, its__set_name__
method (if exists) will be invoked with the class object and attribute name. This makes the descriptor aware of the class it's defined in, and the name it's associated with, which then allows us to differentiate between descriptors defined in a super class vs. those defined in the current class.Due to implementation limits, this is only supported for Python 3.6+; other versions will use the old behavior.
For more information, see the Python docs or PEP 487.