very Very VERY dumb Question About The new Set( ) 's
Inyeol Lee
inyeol.lee at siimage.com
Thu Jul 24 19:15:17 EDT 2003
On Thu, Jul 24, 2003 at 10:31:11PM +0000, Alan Gauld wrote:
[...]
> Since both dictionaries and Sets require unique members/keys,
> why not use the dictionary braces but without the key/value
> syntax. So:
>
> mySet = {1,2,3,4}
>
> Which is illegal for a dictionary but would be OK for a Set.
> It also just happens to be the same delimiters used in math
> for sets...
See PEP 218. It describes a long term plan to make set builtin type,
including syntax for constant set {1,2,3,4} and empty set {-}.
Inyeol
More information about the Python-list
mailing list