Skip to content

Should Outcome objects consume themselves when unwrapped? #7

Closed

Description

@RazerM

From python-trio/trio#466:

@njsmith:

It's generally a mistake to unwrap the same Result object twice, because if it's an exception you'll end up with a corrupted traceback as the same exception object gets raised in two unrelated call stacks.

We should at least document this, and maybe we should make unwrap "consume" the object so that if you call it twice then the second time it raises an error.

Activity

  1. changed the title [-]Should Result objects consume themselves when unwrapped?[/-] [+]Should Outcome objects consume themselves when unwrapped?[/+] on Apr 3, 2018
  2. m-u-xyz commented on Apr 16, 2018

    @m-u-xyz
    Contributor

    Another possibility would be to call warnings.warn, but the PR documents my preference. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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