Skip to content

Function return type is not compatible with usage #921

@arian-deimling

Description

@arian-deimling

def locate(self, current_offset, line) -> Union[LinePart, None]:
return lineparts.current_dict_key(current_offset, line)

Function above declares a possible None return type. Below are lines that unpack without checking the return value.

bpython/bpython/repl.py

Lines 280 to 282 in b66a29f

start, end, word = self.completer.locate(
self.orig_cursor_offset, self.orig_line
)

bpython/bpython/repl.py

Lines 322 to 324 in b66a29f

self.start, self.end, self.current_word = self.completer.locate(
self.orig_cursor_offset, self.orig_line
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions