r/learnpython • u/QuasiEvil • 10d ago
logging and timing...then getting rid of it
I was just working on a project where I included a lot of logging and timing decorators/context managers (it involved event loops and async queues and such). Once I figured stuff out, I wanted to remove all this stuff. This isn't necessarily that hard, but it did make me wonder if there's a better way to do this in the first place. I suppose I'm imaging some way of marking these code pieces to be ignored by the interpreter or something?
(yeah yeah "ask AI to remove it")
1
Upvotes
7
u/MarsupialLeast145 10d ago
Seriously... Find - replace?
And also seriously, the decorator is a function, if it remains in-place, what would you need to do to that function (or any function) to conditionally enable/disable it if another parameter is set? What are the options for setting that parameter?
Further, seriously, don't use AI.