Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 825903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:19:44+00:00 2026-05-15T03:19:44+00:00

I try to adhere to the style guide for Python code (also known as

  • 0

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 without exception, class names
use the CapWords convention. Classes for internal use have a leading underscore in addition.

How can I be consistent with PEP 8 if my class name is formed by two acronyms (which in proper English should be capitalized). For instance, if my class name was ‘NASA JPL’, what would you name it?:

class NASAJPL():  # 1
class NASA_JPL(): # 2
class NasaJpl():  # 3

I am using #1, but it looks weird; #3 looks weird too, and #2 seems to violate PEP 8.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:19:44+00:00Added an answer on May 15, 2026 at 3:19 am

    PEP-8 does cover this (at least partially):

    Note: When using acronyms in CapWords, capitalize all the letters of the acronym. Thus HTTPServerError is better than HttpServerError.

    Which I would read to mean that NASAJPL() is the recommended name according to PEP-8.

    Personally I’d find NasaJpl() the easiest to scan since the upper case letters easily mark word boundaries and give the name a distinctive shape.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Try the following sample code: <div style=background-color:#ddd> <div style=width:900px; margin:0px auto> <div class=row> <div
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
try: html = urlopen('http://glbse.com/api/asset/' + asset.name) except: print 'error while updating the price of
Try as I might I cannot get my head around what the IteratorIterator class
Try the following in python 2.6: newyear_2012 = datetime.date.fromtimestamp(1325419200) newyear.year # returns 2012 newyear.isocalendar()
First time posting, I will try to adhere to best practices. I'm trying to
Try this: Make a new XCode4 Applescript project. In the delegate, paste this code:
Try this: <div style=float:left><p>LEFT</p></div> <div style=float:right><p>RIGHT</p></div> <div><p> <input type=text style=width:100% /> <input type=submit />
try { using (MapDataContainer ent = new MapDataContainer()) //is an autogen'd EF object {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.