Giter VIP home page Giter VIP logo

stubcheck's People

Contributors

jellezijlstra avatar

Watchers

 avatar  avatar

Forkers

comfort4u

stubcheck's Issues

Deal with OS-specific names

These:

+selectors: 'DevpollSelector' is in stub but is not defined at runtime
 +selectors: 'EpollSelector' is in stub but is not defined at runtime
 +selectors: 'PollSelector' is in stub but is not defined at runtime

happen because the selectors only exist on OSs with the underlying syscalls available.

stubcheck should either (1) implement a clever way to detect that these are OS-specific or (2) provide a way to whitelist specific names. The only way I can think of to do (1) is to do source code analysis on the module and find that DevpollSelector is defined inside an if block, but that seems hacky and won't work for C modules anyway, so I'll probably go with (2).

Proposed format: We add a file tests/stubcheck_blacklist.txt to typeshed. Every line in this file is either a comment starting with #, a blank line, or of the form selectors.DevpollSelector. Such a line tells stubcheck to suppress all errors related to selectors.DevpollSelector. To suppress all errors in the selectors module, we could accept a glob like selectors.*. Alternatively, it could accept file names, so stdlib/3.4/selectors.pyi will suppress all errors in that file. But that would block stubcheck from finding other errors: for example, if DevpollSelector does exist, it should still be able to check that its methods have the right signature.

deal with namespace packages

Currently stubcheck reports

+xml: 'dom' is in __all__ but not in stub
 +xml: 'etree' is in __all__ but not in stub
 +xml: 'parsers' is in __all__ but not in stub
 +xml: 'sax' is in __all__ but not in stub

At runtime, these are in __all__ but they're not directly imported in xml/__init__.py, so the stub is correct. stubcheck needs to detect this situation. It also affects the email package.

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.