Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.11']
python-version: ['3.14']

steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.14
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "uv_build"
name = "iterum"
description = 'Rusty iterators in Python.'
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.14"
license = "MIT"
keywords = []
authors = [
Expand All @@ -15,7 +15,7 @@ authors = [
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
]
version = "0.2.0"
Expand Down
6 changes: 3 additions & 3 deletions src/iterum/_iterum.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from abc import abstractmethod
from collections.abc import Callable, Iterable, Iterator
from dataclasses import dataclass
from typing import TYPE_CHECKING, Generic, TypeVar, overload
from typing import TYPE_CHECKING, TypeVar, overload

from ._helpers import check_methods
from ._notset import NotSet, NotSetType
Expand Down Expand Up @@ -1541,7 +1541,7 @@ def zip(self, other: Iterable[U], /) -> Zip[T_co, U]:
return Zip(self, other)


def _try_next(itr: Iterator[T], /) -> Option[T]:
def _try_next[T](itr: Iterator[T], /) -> Option[T]:
try:
nxt = next(itr)
except StopIteration:
Expand Down Expand Up @@ -1722,7 +1722,7 @@ def peek(self, value: T_co) -> None: # type: ignore | reason: still need to con


@dataclass
class State(Generic[T]):
class State[T]:
"""
Simple class which holds some mutable state.
"""
Expand Down
8 changes: 3 additions & 5 deletions src/iterum/_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
from typing import (
TYPE_CHECKING,
Any,
Generic,
Literal,
NamedTuple,
NoReturn,
TypeAlias,
TypeVar,
overload,
)
Expand All @@ -27,7 +25,7 @@
O = TypeVar("O", bound="Option") # noqa: E741


class Swap(NamedTuple, Generic[T, U]):
class Swap[T, U](NamedTuple):
"""
Used for various 'swapping' operations on [Option][iterum.Option].
"""
Expand Down Expand Up @@ -626,7 +624,7 @@ def zip(self, other: Option[U], /) -> Nil:
"""


class Some(Generic[T]):
class Some[T]:
"""
[Some][iterum.Some] value of type T.

Expand Down Expand Up @@ -1169,7 +1167,7 @@ def zip(self, other: Option[U], /) -> Option[tuple[T, U]]:
return nil if isinstance(other, Nil) else Some((self._value, other._value))


Option: TypeAlias = "Some[T] | Nil"
type Option[T] = "Some[T] | Nil"
"""
Type alias representing something which is either of type
[Some][iterum.Some] or [Nil][iterum.Nil].
Expand Down
4 changes: 2 additions & 2 deletions type_tests/type_iter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from collections.abc import Iterable
from typing import Generic, TypeVar, assert_type
from typing import TypeVar, assert_type

from iterum import (
Chain,
Expand Down Expand Up @@ -35,7 +35,7 @@
T = TypeVar("T")


class MyCollection(Generic[T]):
class MyCollection[T]:
def __init__(self, _: Iterable[T]) -> None: ...


Expand Down
317 changes: 2 additions & 315 deletions uv.lock

Large diffs are not rendered by default.