Skip to content

Typing hints: add "| None" to function/method arguments that take a None default value. #371

@rodrigobr-msft

Description

@rodrigobr-msft

There are many functions/methods that have parameters with default values of None but whose typing annotations do not include None. Example:

@staticmethod
    def attachment(
        attachment: Attachment,
        text: str = None,
        speak: str = None,
        input_hint: InputHints | str = None,
    ):

while the correction would be:

@staticmethod
    def attachment(
        attachment: Attachment,
        text: str | None = None,
        speak: str | None = None,
        input_hint: InputHints | str | None = None,
    ):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions