Registry / type-stubs / types-first

types-first

JSON →
library2.0.5.20260408pypypiunverified

This package provides PEP 561 compatible type stubs for the `first` library. It enables static type checkers like MyPy to correctly analyze code that uses the `first` function, enhancing code quality and preventing type-related errors. The current version is 2.0.5.20260408, and it's released as part of the `typeshed` project, which updates periodically.

pip install types-first
INSTALL
IMPORT
SIG · TYPES-FIRST
T
types-first
type-stubspythonv2.0.5.20260408
Install
1.5s avg
Import
Disk
65MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.5.20260408 · 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.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 65.5MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
65MB installed
● package 65MB
Code
Verified usage

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

first
from first_stubs import first
from first-stubs import first

This quickstart demonstrates how to use the `first` function with type hints. Installing `types-first` allows static analysis tools like MyPy to verify the types, such as ensuring `get_first_even` correctly handles `Optional[int]`.

from typing import List, Optional from first import first def get_first_even(numbers: List[int]) -> Optional[int]: """Finds the first even number in a list using the 'first' library.""" # MyPy will use types-first to understand 'first' returns Optional[int] return first(numbers, key=lambda x: x % 2 == 0) # Example usage with type hints data: List[int] = [1, 3, 4, 5, 6] result: Optional[int] = get_first_even(data) print(f"First even number: {result}") # Expected: 4 data_no_even: List[int] = [1, 3, 5] result_no_even: Optional[int] = get_first_even(data_no_even) print(f"First even number (none found): {result_no_even}") # Expected: None
Debug
Known issues
gotchaInstalling `types-first` only provides static type information; it does not include the actual `first` runtime library. Your application will encounter a `ModuleNotFoundError` if `first` is used in code without `pip install first`.
fix
Always install both `first` and `types-first`: `pip install first types-first`.
affects: All versions
gotchaType stub versions can sometimes lag behind or become out of sync with the runtime library versions. This might lead to incorrect type checking or false positives/negatives from static analysis tools if the API of `first` changes without corresponding stub updates.
fix
Ensure both `first` and `types-first` are updated regularly. If encountering type errors, check the `typeshed` GitHub repository for the latest status or specific issues related to `first` stubs.
affects: All versions
gotchaFor stub packages, direct imports like `import types_first` are not used. The `types-first` package simply needs to be installed in the environment for type checkers to find it when processing imports of the `first` library.
fix
Do not attempt to import `types_first`. Continue to import the actual runtime library: `from first import first`.
affects: All versions
Upgrade
Version history
2.0.5.20260408latest on PyPI · released Apr 8, 2026
Audit
Dependencies
firstrequiredThis package provides type stubs for the 'first' runtime library; it is not functional without 'first' itself.
Agent activity
35 hits · last 30 days
node
32
OpenAI (training)
1
Resources
types-first — pip install types-first · libregistry