objprint icon indicating copy to clipboard operation
objprint copied to clipboard

Feature: Add a time limit for `op` and `objprint`

Open WangGithubUser opened this issue 2 years ago • 2 comments

Feature request

We can use op or objprint's option depth to control the time spend in printing.But, if we don't know the suitable depth, or even we don't know or can't know what the object is, a time limit can make the program to not stuck.

If you wish, I can bring you a implementation of this.

WangGithubUser avatar Aug 15 '23 05:08 WangGithubUser

It's true that objprint can in theory spend a long time iterating through the object, but that's not something we should deal with a timeout. print has a similar issue - it can be stuck printing an object, and the way to get out of it is just Ctrl+C. It's ultimiately in user's control and responsibility to make objprint work as they wish.

gaogaotiantian avatar Aug 17 '23 00:08 gaogaotiantian

But a print seldom stuck, and if you run op with honor_existing=False, it will simply stuck. And, for

and the way to get out of it is just Ctrl+C

,if I need batch processing?Maybe I need to print the object that can finish in a set time.

WangGithubUser avatar Aug 17 '23 02:08 WangGithubUser