[Python-Dev] syntactic support for sets (original) (raw)
John J Lee jjl at pobox.com
Thu Feb 2 21:30:00 CET 2006
- Previous message: [Python-Dev] syntactic support for sets
- Next message: [Python-Dev] syntactic support for sets
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 1 Feb 2006, Greg Wilson wrote:
Like many things in Python where people pre-emptively believe one thing or another, the interpreter's corrective feedback is immediate: Yup, that's the theory; it's a shame practice is different.
So what mistake(s) do your students make? As people have pointed out, the mistake you complain about does usually result in an immediate traceback:
set(1, 2, 3) Traceback (most recent call last): File "", line 1, in ? TypeError: set expected at most 1 arguments, got 3 set(1) Traceback (most recent call last): File "", line 1, in ? TypeError: iteration over non-sequence
Perhaps this?
set("argh") set(['a', 'h', 'r', 'g'])
[...]
the language, but I'd rather eliminate the sand traps than reuqire people to learn to recognize and avoid them.
I'm sure nobody would disagree with you, but of course the devil is in the detail.
John
- Previous message: [Python-Dev] syntactic support for sets
- Next message: [Python-Dev] syntactic support for sets
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]