Skip to content

Unit method like IOResultE.from_value must return IOResult[_V, Exception] type #407

@sobolevn

Description

@sobolevn

Currently, they do return incorrect types:

reveal_type(IOResultE.from_value(int))
# => IOResult[int, Any]

# Should be:
# => IOResult[int, Exception]

To achieve what we want we might tweak the way we create an alias in some way:

  1. We can use inheritance instead of aliasing
  2. We can use some magic
  3. mypy plugin?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions