Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   RE: Set literals (http://www.velocityreviews.com/forums/t342889-re-set-literals.html)

Delaney, Timothy C (Timothy) 03-21-2005 11:03 PM

RE: Set literals
 
George Sakkis wrote:

> How about overloading curly braces for set literals, as in
>
>>>> aSet = {1,2,3}

>
> - It is the standard mathematic set notation.
> - There is no ambiguity or backwards compatibility problem.
> - Sets and dicts are in many respects similar data structures, so why
> not share the same delimiter ?


This was the proposed syntax (with {-} being the empty set - there's the
ambiguity). The issue may be revisited for Python 3K, but for now there
will not be syntax support for sets.

Read the section on 'Set Notation' in:
http://www.python.org/peps/pep-0218.html

Tim Delaney

George Sakkis 03-22-2005 12:02 AM

Re: Set literals
 
"Delaney, Timothy C (Timothy)" <tdelaney@avaya.com> wrote:

> > How about overloading curly braces for set literals, as in
> >
> >>>> aSet = {1,2,3}

> >
> > - It is the standard mathematic set notation.
> > - There is no ambiguity or backwards compatibility problem.
> > - Sets and dicts are in many respects similar data structures, so why
> > not share the same delimiter ?

>
> This was the proposed syntax (with {-} being the empty set - there's the
> ambiguity). The issue may be revisited for Python 3K, but for now there
> will not be syntax support for sets.
>
> Read the section on 'Set Notation' in:
> http://www.python.org/peps/pep-0218.html
>
> Tim Delaney



Thanks for the link; obviously, I wasn't aware of the proposal and its rejection.

looking-forward-to-python-3K-ly yours,
George




All times are GMT. The time now is 08:12 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.