See Python PEP 8: Function and Variable Names:

Function names should be lowercase, with words separated by underscores as necessary to improve readability.

Variable names follow the same convention as function names.

mixedCase is allowed only in contexts where that's already the prevailing style (e.g. threading.py), to retain backwards compatibility.

Answer from S.Lott on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-naming-conventions
Python Naming Conventions - GeeksforGeeks
July 23, 2025 - Classes in Python names should follow the CapWords (or CamelCase) convention.
Discussions

Is there a standard in naming your variables?
https://peps.python.org/pep-0008/#prescriptive-naming-conventions More on reddit.com
🌐 r/learnpython
30
38
February 12, 2024
Python Class Inheritance: Adhering to Parent Class Naming Conventions vs. PEP 8 Compliance
As PEP8 says at the beginning in the "A Foolish Consistency is the Hobgoblin of Little Minds" paragraph: good reasons to ignore a particular guideline: To be consistent with surrounding code that also breaks it I think that is the answer. More on reddit.com
🌐 r/learnpython
9
1
June 29, 2025
Best practice for naming class instances?
Syntax is fine, but class Functions is big red flag to me. Is it a subset of some sequence class or a list, thus in plural? Is your subject area is functions themselves? Perhaps no, so there is a chance it is bad nane for a class, generally name it to the object you are describing. More on reddit.com
🌐 r/learnpython
8
4
May 16, 2023
Variable naming conventions
What you describe is called Hungarian Notation. The Wikipedia article has a list of pros and cons. It has (imo thankfully) fallen out of favor, and isn’t used in Python, especially since variables in Python don’t have a type, values do. And you can use type hints to achieve the same thing. More on reddit.com
🌐 r/learnpython
9
6
August 12, 2021
🌐
Cornell Computer Science
cs.cornell.edu › courses › cs1110 › 2018fa › materials › style.php
Notes on Python Programming Style
Tuesday, Thursday 9:05 (ILR 315) 11:15 (Call Aud) · CS 1110: Introduction to Computing Using Python
🌐
Reddit
reddit.com › r/learnpython › is there a standard in naming your variables?
r/learnpython on Reddit: Is there a standard in naming your variables?
February 12, 2024 -

Hello!
How do you name your variables? Is there a standard?
I used to name my variables something like "firstNumber = 5" and constants like "MAX_SPEED = 200".
The problem I noticed is that when I look for those variables they are hard to spot on sight.
As such, I decided to write my next programs using notations like "number_of_items = 25".
I feel like using "_" is much more readable that using "numberOfItems = 25" that can look similar to "typesOfItems = 10"

🌐
Python documentation
docs.python.org › 3 › tutorial › classes.html
9. Classes — Python 3.14.4 documentation
“Private” instance variables that cannot be accessed except from inside an object don’t exist in Python. However, there is a convention that is followed by most Python code: a name prefixed with an underscore (e.g.
Find elsewhere
🌐
James Madison University
w3.cs.jmu.edu › spragunr › CS240_F12 › style_guide.shtml
CS240 Python Coding Conventions
Package and Module Names Modules ... although the use of underscores is discouraged. Class Names Almost without exception, class names use the CapWords convention....
🌐
Medium
medium.com › @rowainaabdelnasser › python-naming-conventions-10-essential-guidelines-for-clean-and-readable-code-fe80d2057bc9
Python Naming Conventions: 10 Essential Guidelines for Clean and Readable Code | by Rowaina Abdelnasser | Medium
December 8, 2024 - For class names in Python, follow the CamelCase convention. Start each word with an uppercase letter, without any underscores or hyphens. Class names should be descriptive, reflecting the purpose or behavior of the class.
🌐
Real Python
realpython.com › python-pep8
How to Write Beautiful Python Code With PEP 8 – Real Python
January 12, 2025 - You should use snake case to name Python functions, which means using lowercase words separated by underscores for improved readability. What is the convention for class names in Python?Show/Hide
🌐
Robin Winslow
robinwinslow.uk › summary-of-python-code-style-conventions
A summary of python code style conventions
January 5, 2014 - If you need to use a reserved word, add a _ to the end (e.g. class_)
🌐
Reddit
reddit.com › r/learnpython › python class inheritance: adhering to parent class naming conventions vs. pep 8 compliance
r/learnpython on Reddit: Python Class Inheritance: Adhering to Parent Class Naming Conventions vs. PEP 8 Compliance
June 29, 2025 -

I have a question regarding Python class inheritance and naming conventions. When I derive a class from another and want to implement functionalities similar to those in the parent class, should I reuse the same function names or adhere strictly to PEP 8 guidelines?

For example, I'm developing a class that inherits from QComboBox in PyQt6. I want to add a function to include a new item. In the parent class, addItem is a public function. However, I can't exactly override this function, so I've ended up with the following code:

def addItem(self, text, userData=None, source="program") -> None: # noqa: N802
    """
    Add a single item to the combo box.
    Set the item's text, user data, and checkable properties.
    Depending on the data source, set it as (un)checked.
    Item is checked if it has been added by user, unchecked otherwise.
    """
    item = QStandardItem()
    item.setText(text)
    if userData is not None:
        item.setData(userData)
    item.setFlags(Qt.ItemFlag.ItemIsEnabled | Qt.ItemFlag.ItemIsUserCheckable)
    # Set the check state based on the source
    if source == "user":
        print("Source is user")
        item.setData(Qt.CheckState.Checked.value, Qt.ItemDataRole.CheckStateRole)
    else:
        print("Source is program")
        item.setData(Qt.CheckState.Unchecked.value, Qt.ItemDataRole.CheckStateRole)
    item.setData(source, Qt.ItemDataRole.UserRole + 1)
    self.model().appendRow(item)
    print(f"Added item: {text}, Source: {source}")
    self.updateLineEditField()
🌐
Execute Program
executeprogram.com › courses › python-for-programmers › lessons › naming-conventions
Python for Programmers: Naming Conventions
Learn programming languages like TypeScript, Python, JavaScript, SQL, and regular expressions. Interactive with real code examples.
🌐
NYC Data Science Academy
nycdatascience.com › home › community › events › best naming conventions: python code
Best Naming Conventions: Python Code | Data Science Blog
July 19, 2022 - In Python, the names of variables and functions should be lowercase. Individual words can be separated by underscores when needed. This will improve readability within your code. Method names should follow the same conventions as function names.
🌐
Profound Academy
profound.academy › python-mid › class-naming-conventions-bxS5gJ9tLnPvyZhd5giU
Class Naming Conventions - Intermediate Python
January 18, 2025 - class MyCar: # class name uses CapWords def __init__(self): self.car_model = 'Tesla Model 3' # attribute name uses snake_case def start_engine(self): # method name uses snake_case print('Engine started!') While Python does not strictly enforce these naming conventions, adhering to them makes your code more professional, readable, and consistent.
🌐
TutorialsPoint
tutorialspoint.com › coding-standards-style-guide-for-python-programs
Coding standards (style guide) for Python programs?
Variable names follow the same convention as function names. Always use self for the first argument to instance methods. Always use cls for the first argument to class methods. Use the function naming rules: lowercase with words separated by underscores as necessary to improve readability. Use one leading underscore only for non-public methods and instance variables. To avoid name clashes with subclasses, use two leading underscores to invoke Python's name mangling rules.
🌐
Real Python
realpython.com › python-function-names
How Do You Choose Python Function Names? – Real Python
July 23, 2024 - You can read more about the two leading underscores convention and name mangling in the Single and Double Underscores in Python Names tutorial. ... class BankAccount: def __init__(self, account_number, balance): self.account_number = account_number self.balance = balance def __repr__(self): return ( f"{type(self).__name__}({self.account_number}, {self.balance})" ) def _verify_funds(self, amount): return self.balance >= amount def _deduct_funds(self, amount): self.balance -= amount def _add_funds(self, amount): self.balance += amount def get_balance(self): return self.balance def withdraw(self, amount): if self._verify_funds(amount): self._deduct_funds(amount) return True return False def deposit(self, amount): self._add_funds(amount) return True
🌐
Ni
ni.github.io › python-styleguide
NI Python Styleguide
This includes packages, modules, classes, functions, attributes and other names. ... Imports come after module comments and docstrings and before module globals and constants. # Bad """Module Docstring.""" URL = "http://python.org" import ministry
🌐
Readthedocs
visualgit.readthedocs.io › en › latest › pages › naming_convention.html
Python Naming Conventions — CodingConvention 0 documentation
Class names should follow the UpperCaseCamelCase convention · Python’s built-in classes, however are typically lowercase words · Exception classes should end in “Error” · Global variables should be all lowercase · Words in a global variable name should be separated by an underscore ·
🌐
Scottlarsen
scottlarsen.com › 2021 › 03 › 14 › Python-Naming-Conventions-(PEP-8).html
Scott Larsen - Python Naming Conventions (PEP 8)
Class Names use the CapWords convention (no spaces, capitalize first letter of each word). Constants should use ALL_UPPERCASE (all uppercase letters with underscores as necessary) Private elements (available only internally) should have an _underscore appended in front of them.
🌐
Go
go.dev › doc › effective_go
Effective Go - The Go Programming Language
In any case, confusion is rare because the file name in the import determines just which package is being used. Another convention is that the package name is the base name of its source directory; the package in src/encoding/base64 is imported as "encoding/base64" but has name base64, not encoding_base64 and not encodingBase64.