Skip to content

Update typing in Pyomo #3788

@jsiirola

Description

@jsiirola

Summary

As part of Pyomo 7 we should make an effort to improve type hints across Pyomo.

Rationale

Typing would go a long ways toward help connect users to documentation.

Description

We should strive to provide type hints to all APIs used in The Book examples. This includes:

  • adding type hints for the core Pyomo components
  • ...

Additionally, we are currently very inconsistent in how we use of type hints across Pyomo. Some if it is no longer needed (now that we are only supporting Python 3.10+):

  • remove use of typing.Union and replace with (Python 3.10+) |
  • remove use of typing.List, typing.Tuple, etc and replace with list. tuple, etc. (Python 3.9+)

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpyomo7This is a label for issues targeted for the next major release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions