Skip to content

Commit

Permalink
refactor(core): allow None type for state, action and event types i…
Browse files Browse the repository at this point in the history
…n `ReducerResult` and `CompleteReducerResult`
  • Loading branch information
sassanh committed Oct 5, 2024
1 parent 2942791 commit 4527ef3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 30 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 0.17.1

- refactor(core): allow `None` type for state, action and event types in `ReducerResult` and `CompleteReducerResult`

## Version 0.17.0

- refactor(autorun): remove `auto_call` option as it was addressing such a rare use case that it was not worth the complexity
Expand Down
50 changes: 26 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "python-redux"
version = "0.17.0"
version = "0.17.1"
description = "Redux implementation for Python"
authors = ["Sassan Haradji <sassanh@gmail.com>"]
license = "Apache-2.0"
Expand All @@ -14,8 +14,8 @@ packages = [{ include = "redux" }, { include = "redux_pytest" }]
python = "^3.11"
python-immutable = "^1.1.1"
python-strtobool = "^1.0.0"
pyright = "^1.1.378"
ruff = "^0.6.3"
pyright = "^1.1.383"
ruff = "^0.6.9"

[tool.poetry.group.dev]
optional = true
Expand Down
6 changes: 3 additions & 3 deletions redux/basic_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class BaseEvent(Immutable): ...


# Type variables
State = TypeVar('State', bound=Immutable, infer_variance=True)
Action = TypeVar('Action', bound=BaseAction, infer_variance=True)
Event = TypeVar('Event', bound=BaseEvent, infer_variance=True)
State = TypeVar('State', bound=Immutable | None, infer_variance=True)
Action = TypeVar('Action', bound=BaseAction | None, infer_variance=True)
Event = TypeVar('Event', bound=BaseEvent | None, infer_variance=True)
Event2 = TypeVar('Event2', bound=BaseEvent, infer_variance=True)
SelectorOutput = TypeVar('SelectorOutput', infer_variance=True)
ComparatorOutput = TypeVar('ComparatorOutput', infer_variance=True)
Expand Down

0 comments on commit 4527ef3

Please sign in to comment.