How do you PEP 8-name a class whose name is an acronym?

后端 未结 8 792
抹茶落季
抹茶落季 2020-12-05 04:08

I try to adhere to the style guide for Python code (also known as PEP 8). Accordingly, the preferred way to name a class is using CamelCase:

Almost wi

8条回答
  •  隐瞒了意图╮
    2020-12-05 04:16

    Number 1 is too hard to read for me - there's no way to tell that's it's two acronyms.

    Number 2 violates PEP8, but looks fine. Remember "A foolish consistency is the hobgoblin of little minds" :)

    I like number 3 the best, but I do a lot of C# programming - that's how you'd be supposed to do it in C#.

提交回复
热议问题