Skip to content

Extending pdb.disable to cover other methods? #83

@akatkov7

Description

@akatkov7

Hi,

I've been using the library to set up pdb.set_trace() in various code branches where I might want to look deeper during a local/debug run, but would ignore in a production run. So I added a --debug CLI flag that I pass when running locally and it works great.

However, I want to start using some pdb.post_mortem() (or xpm) in a similar way, but the pdb.disable() only affect set_trace.

So my request is to add a way to also disable the post_mortem options so that they don't trigger similar to set_trace after disable(). If this isn't in scope for this library, then perhaps a workaround would be adding a simple way to detect if the set_trace is disabled so I could wrap post_mortem calls in if pdb.is_enabled() or equivalent.

Let me know if this makes sense. Thanks for the library!

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