Skip to content

Support Type Hints #2794

@seisman

Description

@seisman

This issue is still in draft mode. Type hints are something new to me, so I need to learn more and will keep improving the issue description.

What's Python's Type Hints

Why we should support type hints

Copied from https://vegibit.com/introduction-to-python-type-hints/.

  • Improved code readability: Type hints make it easier for other developers to understand your code. By clearly specifying the types of arguments and return values, you can help others quickly grasp the intent of your code.
  • Improved development speed: With type hints, you can catch potential bugs and errors early in the development process. This can save you time in the long run, as you can fix errors before they cause problems in your code.
  • Improved tooling support: Many tools, such as static analyzers and IDEs, use type hints to provide better support for your code. For example, they can use type hints to catch potential errors, suggest code improvements, or provide better autocompletion.
  • Better auto-completion for parameter values: See POC: Showcases for support type hints #2793 for how Type Hints can affect the way we use PyGMT.

Tasks

References:

Related PEPs

Metadata

Metadata

Assignees

No one assigned

    Labels

    longtermLong standing issues that need to be resolvedtypingType hints and static type checking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions