Skip to content

Use from __future__ import annotations (almost?) everywhere? #40533

Closed
@MarcoGorelli

Description

@MarcoGorelli

This means we can address

type hints are executed at module import time, which is not computationally free.

(from https://www.python.org/dev/peps/pep-0563/), as well as use the more modern syntax of Python


This is easy to automate, just checking there's no downsides to putting this everywhere. Should any files (probably __init__.py, any others?) be excluded? cc @simonjayhawkins

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs DiscussionRequires discussion from core team before further actionTypingtype annotations, mypy/pyright type checking

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions