question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enforce strict class attribute names

See original GitHub issue

We need to track this issue in pep8-naming: https://github.com/PyCQA/pep8-naming/issues/78

In the worst case scenario we will need to implement this rule in our linter.

Thesis

We need to enforce snake_case class attribute names. Currently one case use any notation. Without any limitations.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lensvolcommented, Oct 7, 2018

I’m willing to take this over. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - How to force/ensure class attributes are a specific type?
You can use this to enforce the type check: class A: def __init__(self, a0): self.a = a0 def __setattr__(self, name, value): if name...
Read more >
Class attributes naming rules · Issue #78 · PyCQA/pep8-naming
Enforce strict class attribute names ... defined with upper-case names. I'd like to see warnings about camelCase class attributes, however.
Read more >
Classes - Object-Oriented Programming in Python
When we set an attribute on an instance which has the same name as a class attribute, we are overriding the class attribute...
Read more >
Python Class Attributes: An Overly Thorough Guide - Toptal
Python class attributes can lead to elegant code—as well as bugs. This guide outlines use cases for attributes, properties, variables, objects, and more....
Read more >
9. Classes — Python 3.11.1 documentation
Creating a new class creates a new type of object, allowing new instances of that type ... Strictly speaking, references to names in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found