Comments (7)
Possibly related: #9420
from pylint.
ABC1 has an additional public method "getitem". Is that what you find unexpected that pylint counted?
from pylint.
class Test has two public methods: __getitem__
and method1
(no warning, as expected)
class MyABC1 has two public methods: getitem
and method1
(no warning, as expected)
class MyABC2 has two public methods: __getitem__
and method1
(no warning, as expected)
class Concrete1 implements the abstract method method1
of MyABC1 (no warning, as expected)
class Concrete2 implements the abstract method method1
of MyABC2 (warning, unexpected)
from pylint.
Ah, if the difference is just that too-few-public-methods thinks anything that starts with _
is private even if it's a dunder, then that's just #9420.
from pylint.
According to this logic ("too-few-public-methods thinks anything that starts with _ is private"), then there should be a warning for class Test
- but there is not. (same for class MyABC2
)
from pylint.
Apologies, I took #9420 at face value, but I cannot reproduce the behavior described there. Dunders besides __init__()
are counted as public methods, so that explains why Test
doesn't raise a warning.
from pylint.
Apparently, inherited dunders are not counted. If that's the part you'd like us to reconsider, I'm happy to reopen the issue for additional discussion.
from pylint.
Related Issues (20)
- E1101 raised when accessing a not annotated property returning a dynamic object HOT 1
- Add check for using major 3.11 and 3.12 features with lower `--py-version`
- ``pyreverse`` should check that ``klass`` is still ``ClassDef`` HOT 3
- FN `attribute-defined-outside-init` with `setattr()`
- False positive R1730 consider-using-min-builtin, R1731 consider-using-max-builtin
- Crash ``whilst running pylint in vscode`` HOT 1
- False positive `arguments-differ` on `__post_init__` method in dataclass inheritence
- [pyreverse] Dunder methods in diagrams HOT 1
- Report global object redefinition
- pylint does not recognize pytest fixtures HOT 1
- False positive for optional class attribute HOT 1
- False positive for optional class attribute HOT 1
- False positive for no-member with property setters HOT 4
- False positive `not-async-context-manager` with Pydantic `PrivateAttr`
- Weird __slots__ manip causes pylint to crash
- `used-before-assignment` false positive for `type` alias
- `from __future__ import annotations` is 3.7+
- Standard collection typing is 3.9+
- Assign expression / walrus operator is 3.8+
- Positional-only parameters are 3.8+
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylint.