Skip to content

Typed Return Type for flatmap contradicts documentation #6

@mrwizard82d1

Description

@mrwizard82d1

The documentation for flatmap states: "This is different than Option.map() because the result of the callback isn’t wrapped in a new Option." This test verifies that behavior:

    def test_flatmap_some():
        assert_that(option.Some(4).flatmap(lambda x: x + 1), equal_to(5))

However, the return type of the function is specified to be Option[U].

What is the expected behavior flatmap?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions