Code Monkey home page Code Monkey logo

Comments (5)

JelleZijlstra avatar JelleZijlstra commented on June 7, 2024 1

Maybe a better approach would be configuring the python version to target

That doesn't make sense for stubs because stubs are mostly independent of Python version. TypeAlias for example should work in all Python versions in stubs (assuming you import it from typing_extensions); the problem is that pytype doesn't support it yet.

from flake8-pyi.

JelleZijlstra avatar JelleZijlstra commented on June 7, 2024

https://flake8.pycqa.org/en/latest/plugin-development/index.html doesn't say anything about creating codes that are disabled by default, so probably there still isn't a native way to do this. In working on #86 I noticed that it's really easy to disable everything else while trying to turn on a disabled-by-default check, so I think it's going to be a better way forward to get rid of the disabled-by-default checks.

from flake8-pyi.

Akuli avatar Akuli commented on June 7, 2024

There's a comment that says the functionality is "Adapted from flake8-bugbear". We could look at how flake8-bugbear does this, and whether it has the same problems.

from flake8-pyi.

JelleZijlstra avatar JelleZijlstra commented on June 7, 2024

Their code is still basically the same: https://github.com/PyCQA/flake8-bugbear/blob/master/bugbear.py#L131.

from flake8-pyi.

Akuli avatar Akuli commented on June 7, 2024

Here's another idea: You typically want to use the most modern syntax that a specific Python version supports. For example, if you target 3.9+ you can use explicit type aliases, but if you target 3.8+ you can't. (Edit: I'm no longer sure if this makes sense. Doesn't typing_extensions backport basically everything?)

Maybe a better approach would be configuring the python version to target, instead of enabling individual disabled-by-default error codes? Or if that isn't possible, enable everything by default (as if you targeted the latest Python version), and ask users to silence warnings if they support something older too?

from flake8-pyi.

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.