Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I start a helper function with underscore(s)? [duplicate]

In a module, should I use one, two, or no underscores to denote a helper function the user should not call?

like image 472
MarJamRob Avatar asked Oct 29 '25 21:10

MarJamRob


1 Answers

PEP-8, the Python Style Guide, suggests a single leading underscore.

The following special forms using leading or trailing underscores are recognized (these can generally be combined with any case convention):

  • _single_leading_underscore: weak "internal use" indicator. E.g. from M import * does not import objects whose name starts with an underscore.
  • ...
like image 97
Matt Ball Avatar answered Oct 31 '25 12:10

Matt Ball