Registry / type-stubs / types-six

types-six

JSON →
library1.17.0.20260724pypypi✓ verified 25d ago

This package provides typing stubs for the `six` library, enabling static type checking for code that uses `six`. It is part of the community-maintained Typeshed project, which regularly releases updated stubs for third-party packages. The current version, 1.17.0.20260408, aims for compatibility with `six==1.17.*` and is designed for modern Python 3 environments.

pip install types-six
INSTALL
IMPORT
SIG · TYPES-SIX
T
types-six
type-stubspythonv1.17.0.20260724
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.17.0.20260724 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

six-stubs
import six_stubs
import six-stubs

This example demonstrates using a common utility from the `six` library (`six.moves.urllib.parse`) and applying type hints from `types-six`. After installing `six`, `types-six`, and a type checker like `mypy`, you can run `mypy example.py` to verify the types. `types-six` ensures that `mypy` understands the types of `six`'s functions and constants, such as `six.text_type`.

import six.moves.urllib.parse def get_scheme(url: six.text_type) -> six.text_type: parsed_url = six.moves.urllib.parse.urlparse(url) return parsed_url.scheme url_str: six.text_type = 'http://example.com/path' scheme: six.text_type = get_scheme(url_str) print(f"The scheme is: {scheme}") # To type-check this: # 1. pip install six types-six mypy # 2. Save the code above as example.py # 3. Run: mypy example.py
Debug
Known issues
gotchaThe `six` library is primarily intended for maintaining Python 2 and 3 compatibility in a single codebase. For new Python 3-only projects, it is generally recommended to use native Python 3 features directly (e.g., `urllib.parse` instead of `six.moves.urllib.parse`) to avoid unnecessary abstraction layers and potential confusion.
fix
For new Python 3 projects, refactor code to use standard Python 3 library functions directly. Only use `six` if maintaining a codebase that must run on both Python 2 and Python 3.
affects: All versions
gotcha`types-six` (and Typeshed stubs generally) are designed for modern Python versions. Specifically, `types-six` requires Python `>=3.10`, even though the runtime `six` library itself supports Python `2.7` and `3.3+`. This means `types-six` cannot be used to provide type hints for older Python 2 or Python 3 projects.
fix
Ensure your development environment's Python version meets the `types-six` requirement (`>=3.10`). For type-checking older Python projects that use `six`, `types-six` is not suitable.
affects: All versions of types-six (current: 1.17.0.20260408)
gotcha`types-six` is a stub-only package. It provides type information solely for static analysis tools (like Mypy, Pyright, PyCharm) and does not contain any executable code or influence runtime behavior. You must install the `six` runtime library separately (`pip install six`) for your application to function.
fix
Always install the `six` runtime library (`pip install six`) alongside `types-six` if your project actually uses `six`.
affects: All versions
Upgrade
Version history
1.17.0.20260724latest on PyPI · released Jul 24, 2026
Audit
Dependencies
sixrequiredRuntime library for which types-six provides type annotations. You must install `six` separately for your code to run.
Agent activity
29 hits · last 30 days
node
24
OpenAI (training)
1
Resources
types-six — pip install types-six · libregistry