Giter Site home page Giter Site logo

Take __all__ into account about pydocstyle HOT 3 CLOSED

pycqa avatar pycqa commented on July 4, 2024
Take __all__ into account

from pydocstyle.

Comments (3)

lvh avatar lvh commented on July 4, 2024 1

__all__ seems to be detected (poorly) by pep257 now.

py27 runtests: commands[8] | pep257 thimble
Could not evaluate contents of __all__. That means pep257 cannot decide which definitions are public. Variable __all__ should be present at most once in each file, in form `__all__ = ('a_public_function', 'APublicClass', ...)`. More info on __all__: http://stackoverflow.com/q/44834/.

from pydocstyle.

adiroiban avatar adiroiban commented on July 4, 2024

From: http://stackoverflow.com/a/2187636/539264

__all__ has two purposes:

Anybody who reads the source will know what the exposed public API is. It doesn't prevent them from poking around in private declarations, but does provide a good warning not to.

When using from mod import *, only names listed in __all__ will be imported. This is not as important, in my opinion, because importing everything is a really bad idea.
  1. I use coding convention, I just define private stuff as _*. I don't use __all__ at all as I find it hard to keep it in sync with the code and it create code duplication.
  2. I don't use 'from stuff import *. So I don't needall` for that

So, I really don't need all.

__all__ can be updated a run time, so I don't think that it is reliable... I don't want for pep257 to start executing the module.

I think that current check_def_has_docstring is fine.

For people wanting more control they can just overwrite current method.

Please don't force me to use __all__! :)

Thanks!

from pydocstyle.

adiroiban avatar adiroiban commented on July 4, 2024

I checked pep8 souce code and it does not define all

While __all__ defines public interface, I do want to have docstring for private method.

Also I want to have docstrings for tests, as those are crucial for maintaining a test suite.

Thanks!

from pydocstyle.

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.