[Python-ideas] Framework for Python for CS101
Chris Barker
chris.barker at noaa.gov
Mon May 25 18:43:36 CEST 2015
Just a note here, that (as an intro to python teacher), I think this is a
pedagogically bad idea.
At least if the goal is to teach Python -- while you don't need to
introduce all the complexity up front, hiding it just sends students down
the wrong track.
On the other hand, if you want a kind-of-like-python-but-simpler language
to teach particular computer science concepts, this kind of hacking may be
of value.
But I don't think it would be a good idea to build that capability inot
Python itself. And I think you can hack in in with monkey patching anyway
-- so that's probably the way to go.
for example:
"""So for example I prefer to start with the immutable (functional)
subset"""
you can certainly do that by simply using tuples and the functional tools.
(OK, maybe not -- after all most (all?) of the functional stuff returns
lists, not tuples, and that may be beyond monkey-patchable)
But that's going to be a lot of hacking to change.
Is it so bad to have them work with lists in a purely functional way?
-Chris
On Mon, May 25, 2015 at 1:01 AM, Andrew Barnert via Python-ideas <
python-ideas at python.org> wrote:
> On May 24, 2015, at 22:06, Rustom Mody <rustompmody at gmail.com> wrote:
>
> Context: A bunch of my students will be working with me (if all goes
> according to plan!!)to hack on/in CPython sources.
>
> One of the things we would like to try is a framework for CS101 [Intro to
> programming]
>
> So for example beginners get knocked out by None 'disappearing' from the
> prompt
> Correctable by
>
> >>> import sys
> >>> sys.displayhook = print
>
> Now of course one can say: "If you want that behavior, set it as you
> choose"
> However at the stage that beginners are knocked down by such, setting up a
> pythonstartup file is a little premature.
>
> So the idea (inspired by Scheme's racket) is to have a sequence of
> 'teachpacks'.
> They are like concentric rings, the innermost one being the noob ring, the
> outermost one being standard python.
>
>
> How exactly does this work? Is it basically just a custom pythonstartup
> file that teachers can give to their students? Maybe with some menu- or
> wizard-based configuration to help create the file? Or is this some
> different mechanism? If so, what does setting it up, and distributing it to
> students, look like?
>
> I realize that below you talk about doing things that are currently not
> easy to do in a pythonstartup, like hiding all mutating sequence methods,
> but presumably the patches to the interpreter core would be something like
> adding hide_mutating_sequence_methods() and similar functions that teachers
> could then choose to include in the pythonstartup file or whatever they
> give out.
>
> Now note that while the larger changes would in general be restrictions,
> ie subsetting standard python, they may not be easily settable in
> PYTHONSTARTUP.
> eg sorted function and sort method confusion
> extend/append/etc mutable methods vs immutable '+'
>
> Now different teachers may like to navigate the world of python
> differently.
> So for example I prefer to start with the immutable (functional) subset
> and go on to the stateful/imperative. The point (here) is not so much
> which is preferable so much as this that a given teacher should have the
> freedom to chart out a course through python in which (s)he can cross out
> certain features at certain points for students. So a teacher preferring
> to emphasise OO/imperative over functional may prefer the opposite choice.
>
> [Aside: ACM curriculum 2013 juxtaposes OO and FP as absolute basic in
> core CS
> https://www.acm.org/education/CS2013-final-report.pdf
> pgs 157,158
> ]
>
> So the idea is to make a framework for teachers to easily configure and
> select teachpacks to their taste.
>
> How does that sound?
>
> Rusi
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150525/519320b0/attachment-0001.html>
More information about the Python-ideas
mailing list