Language Syntax

Future import — Python syntax

Enable a compiler feature for the containing module. A future statement must follow only a module docstring, comments, blank lines or other future statements. The annotations feature postpones evaluation in 3.13.

Formal Syntax & Structure

python syntaxpython
from __future__ import feature

Working Example

Example Snippetpython
ns={}exec('from __future__ import annotations\ndef f(x: Missing): pass',ns)print(ns['f'].__annotations__)
Python Reference