Message65358
Our use of range in the first few classes is exactly for iteration
purposes, but I do not like students to have to have too many mysteries.
So I always have liked to show that range(10) simply produces a sequence
of integers. In Python 3.0 range returns a mysterious iteration object.
No thanks. My proposal was to provide a more user friendly
implementation of the str method for this new range object that would
allow the user to see the sequence. I like Python because it is so easy
to start up a shell and poke around and see what things are.
I have no problem, introducing list(range(10)) in week 3 when I start
talking about lists, and I like list comprehensions of that purpose too.
Again, what I do not like is that things that used to be very easy for
students to get a conceptual handle on are now more difficult in 3.0.
- range is one example the dict_keys and dict_values objects are another
example. dict_keys et. al. are much easier to deal with since I've
already covered lists and the list() function by the time I get there.
BTW, I think we must have very different teaching styles as I would
never introduce something as mysterious as list(_) on the first day of
class. I'd be happy to continue our discussion of teaching philosophy
but I doubt that this is the right forum.
Brad |
|
Date |
User |
Action |
Args |
2008-04-11 16:06:27 | bmiller | set | spambayes_score: 0.00685831 -> 0.0068583097 recipients:
+ bmiller, loewis, belopolsky, benjamin.peterson |
2008-04-11 16:06:26 | bmiller | set | spambayes_score: 0.00685831 -> 0.00685831 messageid: <1207929986.66.0.14765359158.issue2610@psf.upfronthosting.co.za> |
2008-04-11 16:06:25 | bmiller | link | issue2610 messages |
2008-04-11 16:06:23 | bmiller | create | |
|