Giter Club home page Giter Club logo

Comments (5)

cjw296 avatar cjw296 commented on September 4, 2024 1

To be clear: I think shipping separate stubs is a really bad idea for any python package, and I was strongly against that part of the PEP. They will invariably get out of date and cause more problems than they solve.

from mock.

cjw296 avatar cjw296 commented on September 4, 2024

Hi! I think the right way to do this would be to just add the type annotations you need upstream (ie: as a CPython PR) and then they will flow down to the backport here.

If you create such a PR, feel free to link it from this issue.

from mock.

GDYendell avatar GDYendell commented on September 4, 2024

Thanks @cjw296. There are stubs specifically for this package here, but they had the same type checks as the stdlib version here. I have just had a PR merged to fix this.

from mock.

cjw296 avatar cjw296 commented on September 4, 2024

You're missing my point: there's no need for separate type stubs, please add typing information you need as a PR to the actual code upstream, so that no separate stubs are needed.

(Unless I'm missing something: my understanding is that type stubs were only intended to be a stop-gap until the source code could have type annotations added to it, if you know different, please explain it to me!)

Also, your link to https://github.com/python/typeshed/blob/master/stubs/mock/mock.pyi gives me a 404.

from mock.

GDYendell avatar GDYendell commented on September 4, 2024

Sorry, I fixed the link.

What I mean is the stubs already existed and needed a small fix to solve the problem. I was wondering why the type annotations aren't already added to cpython, as it is much better for developing against. I am interested in doing that, but it will require significantly more effort and probably be a more drawn out review process to make sure nothing is broken.

from mock.

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.