bags in collections - PEP 320

Discussion in 'Python' started by Peter Dobcsanyi, Apr 29, 2004.

  1. Dear All,

    I have just read PEP-320 and noticed the following comments regarding
    the "collections" package:

    ...
    - ? bag (only if use cases established)
    ...

    I would like to argue for such a use case. We at designtheory.org are
    working on a (maths / stats / comp. sci.) project in the area of Design
    Theory. Design theory intersects with many fields, to mention a few:
    combinatorics, graph theory, finite geometry, coding theory, and the
    design of statistical experiments (from which then name of the field
    comes). Most of our software development will be in Python, although
    the released python software so far is very modest.

    To show why bags are important for us and, in general, for discrete
    mathematicians, here is the definition of the most important type of
    designs. A binary block design is a multiset (that is a 'bag') of
    subsets of a 'base' set; the elements of the base set are called
    'points' and its subsets are called 'blocks'. (Personally, I prefer the
    name bag but most mathematicians use multiset.) A non-binary block
    design is one whose blocks can also be multisets.

    The computations we are facing are very much combinatorial in nature so
    we are happy to see that Sets became a builtin and, of course, would
    like to see a C implementation for bags too. Our pydesign package (will)
    heavily use C extensions. So far we use numarray to compute statistical
    properties of designs, but many more combinatorial functionalities will
    be implemented in C.

    In particular, we are planning to implement a basic permutation group
    package whose core will eventually be a C extension. We would like to
    deal with automorphism groups and isomorphisms of designs on at least a
    basic level within the pydesign package without having to resort to
    specialized mathematical packages like GAP. These functionalities can be
    useful not only for design theorist, but for anybody using Python to
    deal with combinatorial structures, like graphs for example.

    In all of these areas the use of multisets (bags) is pervasive.
    Please, implement it -- so we don't have to :)

    For more details on our project, please visit http://designtheory.org/

    -- ,
    Peter Dobcsanyi
    Peter Dobcsanyi, Apr 29, 2004
    #1
    1. Advertising

  2. Peter Dobcsanyi

    Aahz Guest

    In article <c6rj8i$6i2$>,
    Peter Dobcsanyi <> wrote:
    >
    > - ? bag (only if use cases established)
    >
    >To show why bags are important for us and, in general, for discrete
    >mathematicians, here is the definition of the most important type of
    >designs. A binary block design is a multiset (that is a 'bag') of
    >subsets of a 'base' set; the elements of the base set are called
    >'points' and its subsets are called 'blocks'. (Personally, I prefer the
    >name bag but most mathematicians use multiset.) A non-binary block
    >design is one whose blocks can also be multisets.


    "Use case" in this context refers more to the question of whether a
    given feature should be included as part of the standard package rather
    than expecting people to implement their own. One important question
    that needs to be answered is whether "reasonable" people would be likely
    to come up with different answers for interface and implementation
    (that's what killed much of the TZ support in the datetime module).

    Given the lack of response to your post, I'd suggest that you send your
    comments directly to the PEP author.
    --
    Aahz () <*> http://www.pythoncraft.com/

    "I used to have a .sig but I found it impossible to please everyone..." --SFJ
    Aahz, May 1, 2004
    #2
    1. Advertising

  3. Aahz <> wrote:
    > Given the lack of response to your post, I'd suggest that you send your
    > comments directly to the PEP author.


    Thanks for your suggestion. I already sent my comments to Raymond
    Hettinger and we are being engaged in a discussion.

    Peter
    Peter Dobcsanyi, May 1, 2004
    #3
    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. Doug Poland
    Replies:
    9
    Views:
    728
    VisionSet
    Sep 27, 2003
  2. Christoph
    Replies:
    9
    Views:
    3,828
    Christoph
    Dec 12, 2007
  3. Armin Ronacher
    Replies:
    28
    Views:
    729
  4. mutex
    Replies:
    0
    Views:
    210
    mutex
    Jul 27, 2003
  5. Replies:
    2
    Views:
    96
Loading...

Share This Page