
On Tue, Feb 2, 2021 at 2:37 PM kirby urner <kirby.urner@gmail.com> wrote:
On Tue, Feb 2, 2021 at 5:48 AM André Roberge <andre.roberge@gmail.com> wrote:
Hello everyone,
For about 20 months now, I have been working on a Python package intended to help beginners figure out what went wrong when their program generates a traceback. This package is called Friendly-traceback; you can find the fairly extensive documentation at https://aroberge.github.io/friendly-traceback-docs/docs/html/
Hi André --
I'm reading your docs now.
When I start into Python with beginners, I'll typically start with:
dir( ) # how will HyperKitty mangle this?
showing what's in the namespace, the names Python knows when "in" the namespace.
But then the question right away arises: where are print, hex, str, dict... all these names Python knows?
Answer (as we all know): __builtins__
So then I do a dir(__builtins__)
I think you mean simply __builtins__, without the dir(). I use "pretty" from Rich ( https://rich.readthedocs.io/en/latest/introduction.html?highlight=pretty#pyt...) so that dicts are nicely formatted.
[ pray to HyperKitty for no mangling ] and they see:
Wow! Lots and Lots of names (so that's where everyone has been hiding), many with Error and/or Warning in them. Those come at the top as dir returns string elements alphabetically and capitalized Exceptions list up top (or leftmost).
This will be my bridge to your Friendly-Traceback utility i.e. here would be an (early, introductory) example of a 3rd party project aimed at helping a beginner get the most out of the Python experience.
Tracebacks themselves have that purpose already, and you're enhancing that existing capability, which is easy for beginners to understand. Make a good thing better.
A current weakness in my curriculum is I don't spend enough time on IDE features relating to debugging and live inspecting of what's in the namespace. I demonstrate a lot using Spyder, assuring them a different IDE is just fine. Spyder has features that make it great for screen sharing Python, such as scrollback, the %magics, embedded plots...
Anyway, my point is Exceptions and the Tracebacks they occasion, deserve a direct and early discussion, as any beginner is likely to stumble across both in the course of ordinary REPL use.
I'm still adding pages to my most recent iteration of an Elite School (and I do have synchronous students -- we meet once a week). We'll be discussing your innovative enhancements. Ideally, at least one of us (most likely me) will install it and do Show & Tell (a Lightning Talk).
Back to reading the docs...
Kirby