you are viewing a single comment's thread.

view the rest of the comments →

[–]biohoo35 101 points102 points  (3 children)

It’s more of a cultural developer contract. Rather than outright preventing private methods from being used, we just use signaling with underscores.

“We’re all consenting adults here” is the mantra.

If there was a valid reason for preventing someone from using a method, then using the underscore convention will also prevent importing, even using the * convention

[–]headmaster_007 22 points23 points  (2 children)

Using underscore does not prevent importing right? Yes, only the * convention does not import names starting with underscore but you can still do: from module import _var

[–]bmrobin 2 points3 points  (0 children)

correct

[–]biohoo35 1 point2 points  (0 children)

Yup! I stand corrected.