Use TypeIs instead of TypeGuard
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
Research direction
Start at the isassignable API declaration and inspect its existing type-checking tests, if present. Change the return annotation to TypeIs[T], verify that negative-case narrowing behaves as expected, and document the API change as a major/breaking change.
Written by the indexing model from the issue text.
Description
The isassignable API is currently:
def isassignable(
value: object,
tp: TypeForm[T]† | TypeFormString[T]‡,
/, *, eval: bool = True
) -> TypeGuard[T]: ...
Alter it to return a TypeIs[T] instead, so that type narrowing happens as expected in the negative case, when isassignable returns False.
This change could potentially break API users, so should be marked as a major/breaking change.
- Dominant language
- Python
- Stars
- 88
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from davidfstr/trycast
-
feature
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
feature
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Support TypeForm Openenhancement
-
enhancement upstream
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in davidfstr/trycast
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100