RE: Set literals

Discussion in 'Python' started by Delaney, Timothy C (Timothy), Mar 21, 2005.

  1. 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
     
    Delaney, Timothy C (Timothy), Mar 21, 2005
    #1
    1. Advertising

  2. "Delaney, Timothy C (Timothy)" <> 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
     
    George Sakkis, Mar 22, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Al Wilkerson

    literals

    Al Wilkerson, Sep 21, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,605
    Jonathan Allen
    Sep 25, 2004
  2. Replies:
    15
    Views:
    1,321
    Jerry Coffin
    Feb 1, 2005
  3. John Goche
    Replies:
    8
    Views:
    16,464
  4. George Sakkis

    Set literals

    George Sakkis, Mar 21, 2005, in forum: Python
    Replies:
    3
    Views:
    425
    George Sakkis
    Mar 22, 2005
  5. Steve Howe
    Replies:
    0
    Views:
    221
    Steve Howe
    Oct 24, 2010
Loading...

Share This Page