Registry / devops / future-annotations

future-annotations

JSON →
library1.0.0pypypi✓ verified 34d ago

A backport of `from __future__ import annotations` to Python versions before 3.7. It allows using PEP 563-style postponed evaluation of annotations in Python 3.6.1+. Current version 1.0.0. No longer actively maintained; users are encouraged to upgrade to Python 3.7+.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

The package does not export its own annotations; it enables `from __future__ import annotations` on older Python versions via a site-packages hook. Importing from `future_annotations` will raise ImportError.

from __future__ import annotations

Importing `future_annotations` itself is enough to patch `__future__`. No further usage needed.

import future_annotations

After importing `future_annotations`, you can use `from __future__ import annotations` as if you're on Python 3.7+. The string annotation syntax is accepted.

import future_annotations from __future__ import annotations class Foo: def bar(self) -> 'Foo': # Works on Python 3.6 pass
Debug
Known footguns
deprecatedThis library is no longer actively maintained. Use Python 3.7+ which natively supports `from __future__ import annotations`.
gotchaImporting `future_annotations` enables `from __future__ import annotations` automatically, so you do not need to import it multiple times. However, it only works if imported before any `from __future__` import.
breakingOn Python 3.7+, `import future_annotations` is a no-op and does nothing. This can cause confusion if you think it's needed.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
3
ahrefsbot
1
Resources