[Python-3000] sets in P3K?

Brian Harring ferringb at gmail.com
Fri Apr 28 23:32:07 CEST 2006


On Fri, Apr 28, 2006 at 08:09:24AM -0400, Greg Wilson wrote:
> OK, OK, just so I can get it off my chest:
> 
> - introduce '@' as a prefix operator meaning 'freeze'.
> 
> - [1, 2, 3] is a mutable sequence (our old friend the list)
> 
> - {1, 2, 3} is a mutable set
> 
> - @{1, 2, 3} is an immutable set (i.e., a frozen set --- frozen
>   at creation, so all current optimizations possible)
> 
> - @[1, 2, 3] is an immutable sequence (i.e., a tuple)
> 
> Now, if only I can figure out whether "@x" means "bind the name x
> permanently to its current value to create a symbolic constant" or "freeze
> the object to which x currently refers"... ;-)

Potentially a stupid question, but I've been following this thread for 
a while and I'm still not seeing the real gain of extending the syntax 
for frozen markers/set literals.

Someone care to recap what actually is gained from having a set 
literal?
~harring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-3000/attachments/20060428/a94bf0b4/attachment.pgp 


More information about the Python-3000 mailing list