dse-jarvis / 4genius

project 4genius initiative
MIT License
0 stars 2 forks source link

Use a single leading underscore in the names of "private" methods. #8

Open ulemanstreaming opened 4 years ago

ulemanstreaming commented 4 years ago

Python does not support private and protected class members, but by convention a leading underscore in the name signals that a method is not to be called from outside an object of the class. In addition, code completion suggestions in most editors will not list those methods.

Change all methods that currently have double underscores ("dunder") at beginning and end of the name (__GET__, __get_auth_token__, etc.) to just a single leading underscore: _GET, _get_auth_token, etc. Such dunder names are reserved for predefined special ("magic") methods, like __init__, __str__, __len__, and so on. (Names with only a leading dunder are discouraged; they are effectively hidden by being mangled, but this does not really help keep them private.)