Skip to content

Use as a context manager #96

@jmehnle

Description

@jmehnle

I love this package. I'm wondering if there's a way to use deprecated as a context manager inside a function? The reason is that there is only certain behavior of a function that is deprecated, and this is determined dynamically. So basically I have a if statement inside my function, and only when its condition is satisfied will the deprecated behavior run. Is the only solution to define a nested function to run conditionally, and decorate it as deprecated? Could you be convinced to support a context manager that can be used to wrap local logic that's not a dedicated function?

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