Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

typing-clean

PyPI GitHub Release

Syntax sugar: import contents of built-in typing module — with protected and shortened names.
(_A for Any, _C for Callable, etc.)

TL;DR

You like type-hinted python, but you hate how much EVERY module's namespace is cluttered with typing objects? Then:

  • Instead of importing from typing, import from this typing_clean;
  • Use the same objects, just their names prefixed with underscores (Iterable -> _Iterable);
  • They will stay inside your module, never auto-propagating up the import chain;
  • Ask the maintainers of the lib you use to adopt typing-clean, too.

This module is deliberately the most barebones wrapper: it implements NOTHING. It merely imports from typing with different names. Any IDE should be 100% compatible with it.


What and why

By its very purpose, the entire contents of the built-in typing module is what you'd call "implementation details": whenever any of its objects get imported in a module, they should stay hidden inside the module - never to be suggested by an IDE's autocomplete. And, ideally, never even visible from outside.

But, as you are well aware, this is not what happens. Instead, if you want to code typed python, you're presented a dilemma of how your own module will get polluted by typing - with either or both of:

  • typing's own objects spilled all over your module, while being irrelevant for an outer scope where your module is imported.
    • To add insult to injury, all the "standard" (i.e., non-underscored) names are by default imported into outer scope with wildcard import (from your_module import *), so your module pollutes them upstream... unless you manually add EVERYTHING your module defines by itself to its __all__.
  • importing only typing itself, but adding long prefixes of typing.SpecificType everywhere in your code.

Both clutter the code and IDE autocomplete - either in your own module or from outside.

Ideally, your module should import any typing-related objects with a private (dunder) or at least protected (_) name. But now you just move boilerplate code to the imports section, making it tedious to import each type-hinting class in each of your submodules with as:

from typing import Mapping as _Mapping, TypeVar as _TypeVar, ...

You could define your own service submodule which simply imports from typing with the right names, but then you won't be able to wildcard-import those names from it, unless you list every single name inside __all__... which is exactly what this package does:

  • The classes from typing are imported with underscore prefix;
  • many of the most used ones also have aliases where they are further shortened to just one letter (full names still available);
  • typing itself is also imported as _t, just in case;
  • this module defines its __all__, so:
    • in your module, you can do from typing_clean import *,
    • but the imported objects come underscored, so for an outer module (where yours got imported from), they don't get wildcard-imported.

Short names

Here Built-in
_A Any
_C Callable
_G Generator
_O Optional
_M Mapping
_P Protocol
_U Union

Metadata

Release files for typing-clean 0.0.1a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for typing-clean 0.0.1a0
File Size Uploaded Provenance
typing_clean-0.0.1a0.tar.gz 12.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for typing-clean 0.0.1a0
File Interpreter ABI Platform
typing_clean-0.0.1a0-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / typing_clean-0.0.1a0.tar.gz

Download URL typing_clean-0.0.1a0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b1ee1f571b9a59cec379e1a5f564b9f77cdb45d1833d57fe52ff34180e21cd6f
BLAKE2b-256 checksum
How to use checksums
120e150b0f2cd8642699db34b4a7bbe3f4a7d4053dc7550293d5ce93ea0d3d2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / typing_clean-0.0.1a0-py3-none-any.whl

Download URL typing_clean-0.0.1a0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bef89c839dc52345f7f0b32a0cf8b313309f8193d74ee759ff83d43244794d0a
BLAKE2b-256 checksum
How to use checksums
1cab525b35720b62dc0219e5cb41104f93350464aab3edad4b50c116b6ef396f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for typing-clean 0.0.1a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for typing_clean-0.0.1a0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page