Closed Blindfreddy closed 4 years ago
Is there a (good) reason to use the double underscore at the start of the methods in DHTXX, e.g. def __read(self) ?
As per PEP8 this causes name mangling and often causes trouble in subclasses....
refer https://stackoverflow.com/questions/1301346/what-is-the-meaning-of-single-and-double-underscore-before-an-object-name
and
https://stackoverflow.com/questions/6930144/underscore-vs-double-underscore-with-variables-and-methods
No good reasons, other than it's legacy code I wrote a long while ago that I'm modularising. I don't like 2 x _ as a general rule, so I'll flag removing them as a cleanup exercise.
Cleaned up. Closing.
Is there a (good) reason to use the double underscore at the start of the methods in DHTXX, e.g. def __read(self) ?
As per PEP8 this causes name mangling and often causes trouble in subclasses....
refer https://stackoverflow.com/questions/1301346/what-is-the-meaning-of-single-and-double-underscore-before-an-object-name
and
https://stackoverflow.com/questions/6930144/underscore-vs-double-underscore-with-variables-and-methods