Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC: Add information (maybe just release note) for typing regressions #28077

Open
@seberg

Description

@seberg

It may be helpful to have a (likely very brief) section on how to deal with typing regressions, and I think it would be just fine to amend the 2.2 release notes (and maybe add a link to that for 2.2.1 and/or 2.2.2).

We should also add a "Static typing" section to the release notes, I think.

There were two (main?) regressions for users (whether they are just fixes doesn't matter):

  • The introduction of shape typing
  • The correct floating typing.

And while I know that we have the following options:

  • Add (more generic) type hints manually.
    • For floating this is unfortunate and users should open an issue where necessary, because we can hopefully fix it.
    • For shape typing, this is expected: Users must not do any manual shape types right now. If they (optimistically) did so, we are sorry, but you are out of luck.
  • User --allow-redefinition in mypy for unannotated code (with caveats).
  • Unfortunately, users may have to avoid mypy (I am not sure how feasible this was for @stefanv!)

So in the end, there is almost nothing here, but considering how long the discussion was, maybe it is helpful to do it even if it isn't too many users who need it in the end (I am honestly not sure).

Even better would be to improve the "how to type NumPy"/numpy.typing documentation, but that would seem like a lot of work. Although, adding a .. note:: to not type shapes seems very prudent?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions