Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: Set literals

Reply
Thread Tools

RE: Set literals

 
 
Delaney, Timothy C (Timothy)
Guest
Posts: n/a
 
      03-21-2005
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
 
Reply With Quote
 
 
 
 
George Sakkis
Guest
Posts: n/a
 
      03-22-2005
"Delaney, Timothy C (Timothy)" <(E-Mail Removed)> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python 2.7 parser bug on syntax for set literals ? Steve Howe Python 0 10-24-2010 04:40 AM
Java: byte literals and short literals John Goche Java 8 01-17-2006 11:12 PM
Set literals George Sakkis Python 3 03-22-2005 12:11 AM
Visibility of enumeration literals under use clauses biau@altavista.com VHDL 15 02-01-2005 04:19 AM
literals Al Wilkerson ASP .Net 2 09-25-2004 05:24 AM



Advertisments