Re: [Python-ideas] Check type hints in stack trace printing

2018-06-20 Thread Jacco van Dorp
To clarify some more, you'd then have to use the decorator like: @type_check_on_traceback def three(arg: str) -> str: return "{}({}) ".format(arg, len(arg)) on every function where you want this behaviour. Note that this will also emit warnings on tracebacks of exceptions that are later

[Python-ideas] Check type hints in stack trace printing

2018-06-20 Thread Daniel Sánchez Fábregas
El 14/06/18 a las 14:37, Steven D'Aprano escribió: > On Thu, Jun 14, 2018 at 01:03:37PM +0200, Daniel Sánchez Fábregas wrote: >> My idea consist in: >> Adding a method to perform type checking in traceback objects >> When printing stack traces search for mistyped arguments and warn about >> them

Re: [Python-ideas] Check type hints in stack trace printing

2018-06-17 Thread Ivan Levkivskyi
On 14 June 2018 at 12:03, Daniel Sánchez Fábregas < daniel.sanchez.fabre...@xunta.gal> wrote: > My idea consist in: > Adding a method to perform type checking in traceback objects > When printing stack traces search for mistyped arguments and warn about > them to the user. > > Don't know if it is

Re: [Python-ideas] Check type hints in stack trace printing

2018-06-14 Thread Eric Fahlgren
On Thu, Jun 14, 2018 at 4:03 AM Daniel Sánchez Fábregas wrote: > My idea consist in: > Adding a method to perform type checking in traceback objects > When printing stack traces search for mistyped arguments and warn about > them to the user. > ​ Isn't it faster and far more reliable to run your

Re: [Python-ideas] Check type hints in stack trace printing

2018-06-14 Thread Steven D'Aprano
On Thu, Jun 14, 2018 at 01:03:37PM +0200, Daniel Sánchez Fábregas wrote: > My idea consist in: > Adding a method to perform type checking in traceback objects > When printing stack traces search for mistyped arguments and warn about > them to the user. Can you give a concrete example of how this

[Python-ideas] Check type hints in stack trace printing

2018-06-14 Thread Daniel Sánchez Fábregas
My idea consist in: Adding a method to perform type checking in traceback objects When printing stack traces search for mistyped arguments and warn about them to the user. Don't know if it is in the roadmap, but seems that have a good cost/benefit ratio to me.