mdmintz / pdbp

pdbp (Pdb+): A drop-in replacement for pdb and pdbpp. To replace "pdb", add "import pdbp" to an "__init__.py" file.
Other
75 stars 2 forks source link

how would you feel about using the pdbpp pdb hijack hack? #25

Closed davidszotten closed 1 year ago

mdmintz commented 1 year ago

The pdbpp pdb hijack hack seems dangerous. That's why pdbp isn't using it. That hack lets a package override a System Python library, which can have unintended consequences. Aside from that, (and within that realm), malicious actors could use that hijack ability to do far worse things. I wouldn't be surprised if a future Python version deprecates that ability so that standard Python libraries don't get overridden unexpectedly.

And that's why pdbp is activated differently. Add import pdbp to an __init__.py file (or something similar) to activate it. Then the user can choose when to activate it. This seems better (and safer) than having a Python package automatically override a System Python library as soon as it is installed with pip, for example.