A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-February/060336.html below:

[Python-Dev] syntactic support for sets

[Python-Dev] syntactic support for setsJohn J Lee jjl at pobox.com
Thu Feb 2 21:30:00 CET 2006
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 "<stdin>", line 1, in ?
TypeError: set expected at most 1 arguments, got 3
>>> set(1)
Traceback (most recent call last):
   File "<stdin>", 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
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4