KotlinIsland / KotlinIsland/basedmypy

support a `TypeError` or let `Never` have a message

Open
#663 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
202
Forks
6
PR merge metrics
No merged PRs in 30d

Description

```py
@overload
def f(a: None) -> TypeError["Can't be None"]: ...

@overload
def f(a: object): ...
```
If we want that overload to be invalid, should it be a decorator instead of a return value, a return value indicates that you can call it, but the result will be an error?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing how basedmypy handles overload return annotations and the Never type, since the issue names no files or tests. Clarify whether TypeError[...] should be supported, whether Never can carry a message, and whether the intended behavior belongs in a decorator or a return annotation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.