diff --git a/optional/optional.py b/optional/optional.py index 2333686..c3932ce 100644 --- a/optional/optional.py +++ b/optional/optional.py @@ -1,15 +1,12 @@ -from typing import TypeAlias, TypeVar, overload +from typing import overload from optional.nothing import Nothing from optional.something import Something -T = TypeVar("T") +type Option[T] = Something[T] | Nothing -Option: TypeAlias = Something[T] | Nothing - - -class Optional: +class Optional[T]: """Entrypoint of optional.py Provides static methods to help intelligently create diff --git a/optional/something.py b/optional/something.py index f99040b..b687b4a 100644 --- a/optional/something.py +++ b/optional/something.py @@ -1,10 +1,8 @@ from types import NotImplementedType -from typing import Any, Generic, TypeVar +from typing import Any -T = TypeVar("T") - -class Something(Generic[T]): +class Something[T]: """Represents the presence of a value. Rarely instantiated on its own, see :func:`Optional.of`"""