[Python-ideas] Framework for Python for CS101

Steven D'Aprano steve at pearwood.info
Tue May 26 05:50:48 CEST 2015


On Mon, May 25, 2015 at 10:36:00AM +0530, Rustom Mody wrote:
> Context:  A bunch of my students will be working with me (if all goes
> according to plan!!)to hack on/in CPython sources.

I'm sorry, I see a serious disconnect between what you are trying to do 
(hack on CPython sources) and your students (beginners so early in the 
learning process that they are confused by the fact that None doesn't 
print in the interactive interpreter).

How on earth do you expect that students who cannot even cope with 
"disappearing None" will deal with hacking the CPython source code?

I assume you don't mean the C code of the interpreter itself, but the 
standard library. Even so, the standard library has code written in a 
multitude of styles, some of it is 20 years old, some of it is more or 
less a direct port of Java code, much of it involves the use of advanced 
concepts.

I don't see this as being even remotely viable.

[...]
> 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.

And of course you can do so. But you cannot expect to chart out a *pure* 
OO or *pure* functional course, since Python is not purely either. As a 
deliberate design choice, Python uses both functional and OO concepts 
all the way through the builtins and standard library.

If you insist on a pure approach, Python is the wrong language for you. 
Python uses a hybrid paradigm of functional and procedural and OO and 
imperative approaches.

Why not make that a teaching feature rather than a problem? You can 
compare the different approaches: functional sorted() versus OO .sort(), 
for example. Or have the students write them own OO version of map().


-- 
Steve


More information about the Python-ideas mailing list