(🎁) Flag to make default return type `None` instead of `Any`
Open
Nobody has claimed this yet.
feature
needs discussion
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
🚀 Feature
Most other languages(Kotlin, Rust, Swift etc) have a void(or equivalent) return type by default. Can an option be added to have an implicit None return type.
def foo(): # implicit None
print("hi")
🆕 Update
Basedmypy 1.3 supports this functionality with the --default-return flag.
Contributor guide
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.
Research direction
Start by reviewing mypy's existing option handling and return-type inference, then compare the requested behavior with Basedmypy 1.3's --default-return flag. Done should include a defined command-line option, consistent handling of implicit returns, and tests covering the default and configured behaviors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100