[Edu-sig] Using try / except: any stipulations against routine use?
kirby urner
kirby.urner at gmail.com
Thu Dec 15 18:09:07 CET 2011
On Thu, Dec 15, 2011 at 8:00 AM, Andrew Harrington <aharrin at luc.edu> wrote:
> I'm not sure we are clear on the audience here. I use Python in teaching in
> different situations. For the newbie course with my Hands-on Python
> Tutorial, the main idea is an intro to creative programming, where many
> students will not get to anything more advanced. Python is a great vehicle,
> but my emphasis is not on how much of the language an advanced programmer is
> going to use. The dict get method is not high on my list in the newbie
> class. In that situation I would be drawn to the if key in ... syntax.
>
This is along a really steep climb, almost vertical in some sections.
After 16 lessons ending in an ASCII histogram, plotting word lengths
from the Declaration of Independence, they're in the world of
unittest and GUI programming with Tk, SQL.
By the 3rd module (batch of lessons) they're through regular
expressions, command line parsing.
Multi-threading and multi-process spawning come later, towards
the end.
The first Dog class with dog instances in Lesson 14, first module.
@properties in 3rd module, decorators more generally in last.
> Thanks to Andre for his practical data. Getting real data like that fits in
> two situations:
>
> In a production situation where you need speed now, and you know your
> environment.
> Teaching about the *idea* of timing and optimization (knowing that what is
> optimal now, may not be in the future)
>
timeit module and profile module introduced in fourth batch of
lessons.
I'm working the first three batches only at the moment, on alternate
days. Been doing it about a year now.
> Neither of these apply if you are just doing an intro to basic logical
> concepts in programming.
>
> When I use Python for my upper level cryptography course, I push way more
> advanced approaches.
>
> Andy
>
We could do a lot more with cryptography and I have lots of code
in the wings that does more with a Tractor class. That's the
topic of my Standard Lightning Talk for social occasions and
meetups in Pythonia (Python World).
For example the CropCircle subclass of Tractor does a Mandelbrot.
Complex numbers have to do with some of these large number
multiplication algorithms used in RSA.
But I do more with RSA in my Portland pilots.
There's no automated grading at all and you just keep doing
the assignments until you pass them -- can take double digit
numbers of tries in some cases, especially with programs.
What few multiple choice questions there are (very few) are
hand graded.
Our boss went to Russia and realized the students there were
getting a wholly different education that was non-mechanized
and required more thinking on your feet. This crystallized the
"active learning" or "make math" approach. He thinks Americans
don't know dick for the most part, are basically faking it 24/7
(I would have to agree, especially when it comes to Washington
DC people and at Harvard).
It's funny to watch students tuck little comments and remarks
in their quizzes at first, wondering if "the machine" will notice.
Yet there is no machine, just a dedicated staff spread out in
different cities, using a shared hub in Illinois (the management
is in Sebastopol, the hardware in Illinois).
Kirby
Erratum
>>> print('''\
If I notice students making assertions like "doctstrings must be
triple quoted" I go: """no, you *may* consistently always triple
quote even single-lined strings, but unless you have those
embedded linebreaks, "single quoted docstrings" are not an
impossibility -- not a syntax error, not an oxymoron""" (that's
a paraphrase; sounding more literal given I'm not plowing
through at high speed here).'''.replace("literal", "literary"))
If I notice students making assertions like "doctstrings must be
triple quoted" I go: """no, you *may* consistently always triple
quote even single-lined strings, but unless you have those
embedded linebreaks, "single quoted docstrings" are not an
impossibility -- not a syntax error, not an oxymoron""" (that's
a paraphrase; sounding more literary given I'm not plowing
through at high speed here).
More information about the Edu-sig
mailing list