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

后端 未结 8 786
抹茶落季
抹茶落季 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:21

    As others have noted, NASAJPL is probably the PEP-8 approved form.

    Just to be contrary, however, I would probably use NasaJPL. Because if you are reading it, you pronounce "NASA" as a single word, whereas "JPL" you spell out.

    You can make an argument that this is consistent with PEP-8, since "NASA" is an acronym, but "JPL" is an abbreviation (or initialism, if you want to get pedantic).

提交回复
热议问题