Git Product home page Git Product logo

Comments (7)

clo-vis avatar clo-vis commented on July 22, 2024

Possibly related: #9420

from pylint.

jacobtylerwalls avatar jacobtylerwalls commented on July 22, 2024

ABC1 has an additional public method "getitem". Is that what you find unexpected that pylint counted?

from pylint.

clo-vis avatar clo-vis commented on July 22, 2024

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.

jacobtylerwalls avatar jacobtylerwalls commented on July 22, 2024

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.

clo-vis avatar clo-vis commented on July 22, 2024

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.

jacobtylerwalls avatar jacobtylerwalls commented on July 22, 2024

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.

jacobtylerwalls avatar jacobtylerwalls commented on July 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.