Skip to content

Remove Any type on _convert_type #437

Closed

Description

@DominicOram

Once python/mypy#9773 we can remove the | Any in _convert_type.

Acceptance Criteria

  • Any type hint removed here
  • Type checkers and unit tests still happy

Activity

  1. added this to the 1.0.0 milestone on May 16, 2024
  2. stan-dot commented on Sep 9, 2024

    @stan-dot
    Contributor

    @callumforrester have we moved away from mypy to pyright enough that we can remove | Any without waiting for that mypy issue?

    At the moment it does seem that we use mypy in the project

  3. callumforrester commented on Sep 11, 2024

    @callumforrester
    Contributor

    Pending #619

  4. removed this from the 1.0.0 milestone on Mar 21, 2025
  5. added
    c: cliRelates to CLI code
    and removed on Feb 25, 2026
  6. abbiemery commented on Feb 27, 2026

    @abbiemery
    Contributor

    I don't think this is possible with pythons type system. Where there are cases of unions being passed into _convert_type removing the Any will fail as UnionType is not a type. We can remove the type and just have it as:

    def _convert_type(self, typ: Any, no_default: bool = True) -> type:
    
    

    If we want to clean it up a bit and be explicit about what we are doing (as the Any just flags to disregard any types anyway). Otherwise we can just ignore it.

    (@tpoliaw for a sanity check?)

  7. linked a pull request that will close this issuechore: Remove redundant type #1421on Feb 27, 2026
  8. tpoliaw commented on Mar 3, 2026

    @tpoliaw
    Contributor

    The first line of the method is if typ is NoneType so it can't just be type. I remember unions being a pain so so if we're dealing with the Any case anyway, leaving it just as Any makes sense.

  9. added a commit that references this issue on Mar 4, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions