-
-
Notifications
You must be signed in to change notification settings - Fork 4
propose fix for issue 61 #62
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
Conversation
I will also do a step-by-step debug and get back in about a day! Thanks a lot. |
Hi, I think we have to rever the latest commit because some other sections of the code are breaking by changing getter/setter decorator to return self. I have made a separate issue here: #63 |
@VigneshVSV Just pushed the following changes:
|
To run the full unit tests, you can do cd tests
python -m unittest It needs to pass before I can merge the branch. Unfortunately , for non-admin, its not automatically triggered. |
I have attempted to change my code to pass the unit tests but I observe that the set and del methods are not working because they are trying to change the class which will result in "TypeError: 'mappingproxy' object does not support item assignment". This may or may not be in the scope of the issue and I do not want to change too much of the code. |
Not a problem! This snippet should fix that
However, I can take it from here. Should I do so? I think other parts are working when I checked also in the debugger. If you interested in an explanation, I think this is due class-factory or metaclass behaviour where the |
Also, thanks a lot for the contribution! |
I have implemented the changes you suggested. If you want to take it from here, please do so and merge my additions as needed. |
Thanks again! Its looking pretty good. |
I want to note that in #62 in the chunk between 413 and 420 on parametrized.py I did use getattr rather than obj.dict.get. Not sure if will affect anything. |
Logically its fine! Its probably just a mere few nanoseconds faster to just use the |
Sounds good! I thought there was a slight difference between the two, but wanted to make sure that I wouldn't break anything :) Have a great rest of your day, and thanks for letting me contribute to the project! |
Hi, I published it to pip. Thanks a lot! I had to make one change which was, I reset You can have a look here: https://pypi.org/project/hololinked/ |
Okay got it. So this change has the same functionality but is more readable? |
It just avoids one extra function call. It does not make it more or less readable as if you try |
Fix: For fget, fset, and fdel, I suggest binding the relevant methods to the class. Also use a descriptor protocol for class members.
Tests: I have created the following tests to test my implementation against read-only class property, deletable class property, class properties with default values, and class property with custom getter/setter methods.
Please provide feedback as I am a beginner to this!