Enforce strict class attribute names
See original GitHub issueWe 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:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m willing to take this over. 😃
Closed via https://github.com/wemake-services/wemake-python-styleguide/pull/242