Skip to content

Rethink detection of weakmode #925

Closed

Description

@jhance

Currently we "check the first 10 tokens". This is arbitrary and could lead to weirdness. Imagine a scenario where there are more options like this - there could even be more than 10 and then, well...

I feel like we should check tokens up until the first non-comment or non-docstring and search in any of those.

Activity

  1. JukkaL commented on Oct 14, 2015

    @JukkaL
    Collaborator

    Yeah, that was just a quick hack to get a prototype working. We may also want to reconsider how weak mode works in general. My vision is to make it the default mode, so that you'd get some useful type checking even for programs without any type annotations. I'll file a separate issue about weak mode in general. It could be one of the killer features that will make mypy useful for large projects who can't easily annotate everything.

  2. gvanrossum commented on Sep 16, 2016

    @gvanrossum
    Member

    Honestly I think we should rip out the current implementation of weak mode completely, and maybe start over later if we still want it. AFAIK it's not tested, not used, and not working. @ecprice Thoughts?

  3. JelleZijlstra commented on Jul 1, 2017

    @JelleZijlstra
    Member

    I don't know what "weak mode" was, but it's apparently gone, so this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions