Skip to content

Commit

Permalink
fix(typing): remove __init__ from typing to fix pyright issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bellini666 committed May 12, 2023
1 parent 1a12b1c commit 6d0e932
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 100 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ repos:
- python
- markdown
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.4.0
hooks:
- id: pyupgrade
args:
- --py38-plus
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.262
rev: v0.0.265
hooks:
- id: ruff
args:
Expand Down
4 changes: 2 additions & 2 deletions django_choices_field/fields.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from typing_extensions import TypeAlias
_ValidatorCallable: TypeAlias = Callable[..., None]
_ErrorMessagesToOverride: TypeAlias = Dict[str, Any]

_C = TypeVar("_C", bound="Optional[TextChoices]")
_C = TypeVar("_C", bound=Optional[TextChoices])

class TextChoicesField(Generic[_C], Field[_C, _C]):
choices_enum: type[_C]
Expand Down Expand Up @@ -81,7 +81,7 @@ class TextChoicesField(Generic[_C], Field[_C, _C]):
allow_folders: bool = ...,
) -> TextChoicesField[_C | None]: ...

_I = TypeVar("_I", bound="Optional[IntegerChoices]")
_I = TypeVar("_I", bound=Optional[IntegerChoices])

class IntegerChoicesField(Generic[_I], Field[_I, _I]):
choices_enum: type[_I]
Expand Down
Loading

0 comments on commit 6d0e932

Please sign in to comment.