473,394 Members | 1,481 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

bags in collections - PEP 320

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
Jul 18 '05 #1
2 1422
In article <c6**********@beta.qmul.ac.uk>,
Peter Dobcsanyi <pe***@designtheory.org> 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 (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"I used to have a .sig but I found it impossible to please everyone..." --SFJ
Jul 18 '05 #2
Aahz <aa**@pythoncraft.com> 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
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: njp | last post by:
BlankHi, How do I create a tightly coupled Object 1 such that when I update it in one collection, it is simultaneously and automatically updated in other collections? The collections are defined...
4
by: Hrishi R | last post by:
Hi: The following ASP.NET code segment throws an "Object reference not set to an instance of an object" exception. ------------------ Public Sub Page_Load(Source As Object, E As EventArgs) ...
1
by: Tim T. | last post by:
I'm currently working on a report to forecast production for finished goods. The user can select one or more items to forecast. In addition, they may select one or more warehouses to view...
5
by: Simon | last post by:
Hi all, I am writing a windows application using vb.net on the 1.1 framework. We have in the application, some strongly typed collections that have been written as classes that do not inherit...
4
by: Adam Clauss | last post by:
I ran into a problem a while back when attempting to convert existing .NET 1.1 based code to .NET 2.0 using Generic collections rather than Hashtable, ArrayList, etc. I ran into an issue because...
0
by: Mark E. Fenner | last post by:
Hello all, I was curious if anyone has transitioned some code from using Raymond Hettinger's bag class: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259174 to using 2.5's...
0
by: projectbeach | last post by:
Hi, I've been struggling to create a valid XML schema that implements the following innocent-looking concept: A box may contain a bunch of bags (possibly 0). A bag must contain a bunch of...
4
by: Sid Price | last post by:
Hello, I have a class of objects (Device) that are managed by another object (Devices) with a collection class (DeviceCollection) inherited from Collections.Hashtable. Each of the Device objects...
7
by: Dan Stromberg | last post by:
Is there a particular reason why bags didn't go into 2.5.x or 3000? I keep wanting something like them - especially bags with something akin to set union, intersection and difference.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.