Greg Wilson wrote:
> Interesting --- I think that being able to write down a data structure
> using the same sort of notation you'd use on a whiteboard in a high school
> math class is one of the great strengths of scripting languages, and one
> of the things that makes it possible to use Python, Perl, and Ruby as
> configuration languages (instead of the XML that Java/C# users have to put
> up with). I think most newcomers will find:
>
> x = {2, 3, 5, 7}
>
> more appealing than:
>
> x = set(2, 3, 5, 7)
That looks fine to me, except of course it doesn't work :(
Instead you get set([2, 3, 5, 7]), which is much less attractive and
introduces an unneeded intermediate data structure. Or set((2, 3, 5,
7))... which is typographically prettier, but probably more confusing to
a newbie.
Generator comprehensions + dict() were a nice alternative to dict
comprehension, and also replace the need for set comprehension. I feel
like there might be some clever way to constructing sets? Not that
there's any direct relation to generator expressions that I can see, but
maybe something in the same vein.
--
Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com