[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-09-16 Thread Irit Katriel
Irit Katriel added the comment: Feel free to create a new issue and propose a patch. -- ___ Python tracker ___ ___

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-09-16 Thread Ulrich Petri
Ulrich Petri added the comment: > If we copy all the params from TracebackException (and it will be all params, > why only this one?) Why expose the internal machinery at all? If all additional parameters (and unless I'm miscounting we're talking about 2) were exposed on the convenience

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-05-22 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-05-12 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.11 -Python 3.10 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-16 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch pull_requests: +23054 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24231 ___ Python tracker ___

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-15 Thread Irit Katriel
Irit Katriel added the comment: Generally speaking, I don't think it's a good idea to create redundant APIs. If we copy all the params from TracebackException (and it will be all params, why only this one?) that means more code, more tests, more documentation and a higher cognitive load for

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-15 Thread Ulrich Petri
Ulrich Petri added the comment: That would make it slightly better, but I still think it's a pretty arcane incantation (esp. for newer people). What makes you hesitant to adding the parameter to the convenience functions? -- ___ Python tracker

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-14 Thread Irit Katriel
Irit Katriel added the comment: On the other hand, I think it makes sense to add a print() method to TracebackException so that you can do TracebackException.from_exception(ex, capture_locals=True).print(file) or whatever other combination of current or future params. --

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: I’m not sure I agree that it’s a big win. You can always add such a utility function in your code. -- ___ Python tracker ___

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Ulrich Petri
Ulrich Petri added the comment: Functionally equivalent code would be: print("".join(TracebackException.from_exception(ex, capture_locals=True).format())) vs. (hypothetically) print_exc(capture_locals=True) Which is quite a significant difference IMO. --

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: That said, you can always use TracebackException.from_exception(exc, capture_locals=True).format() which is not much longer than print_exception(exc, capture_locals=True) -- ___ Python tracker

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: Sorry, I spoke too soon - see now that the locals are use in the StackSummary.format(). -- ___ Python tracker ___

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2021-01-13 Thread Irit Katriel
Irit Katriel added the comment: I don't understand this request. If you ask TracebackExceptions to capture_locals then the FrameSummary object gets a dict of the reprs of the locals, which can be introspected and participate in __eq__ checks but nothing else happens with them. What would

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2018-06-21 Thread Farhaan Bukhsh
Farhaan Bukhsh added the comment: Hahah! Let me try to put this on the IRC channel may be someone can help us there. -- ___ Python tracker ___

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2018-06-21 Thread R. David Murray
R. David Murray added the comment: I think we should get one or more of the core devs who were involved in the changes that added that parameter to sign off on whether this is a good idea or not (I have no opinion at the moment). You should be able to find them via git blame and looking at

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2018-06-17 Thread Farhaan Bukhsh
Farhaan Bukhsh added the comment: Hey, I would like to work on this, where do I start or how can I help? -- nosy: +fhackdroid ___ Python tracker ___

[issue33809] Expose `capture_locals` parameter in `traceback` convenience functions

2018-06-08 Thread Ulrich Petri
New submission from Ulrich Petri : Since 3.5 the internal machinery of the `traceback` module has gained the very useful ability to capture locals. It would be useful to also expose that ability through the various convenience functions. -- components: Library (Lib) messages: 319079