Skip to content

(🎁) Flag to make default return type None instead of Any #9413

Open
@KotlinIsland

Description

@KotlinIsland

🚀 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions