Is it a convention to prefix private classes with underscores?

后端 未结 4 1068
小鲜肉
小鲜肉 2021-01-17 22:35

I have seen code in which functions/constants are prefixed with underscores. My understanding is that this indicates that they are not to be used directly. Can I do this wit

4条回答
  •  一生所求
    2021-01-17 22:51

    Yes, and this is not only a convention. When you import * from this module, names starting with underscore will not be imported.

提交回复
热议问题