473,805 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

bags in collections - PEP 320

Dear All,

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

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

I would like to argue for such a use case. We at designtheory.or g 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 1436
In article <c6**********@b eta.qmul.ac.uk> ,
Peter Dobcsanyi <pe***@designth eory.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**@pythoncra ft.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**@pythoncra ft.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
2066
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 at the module level for the entire project to access as well as collections defined within different objects. Currently, I'm updating Object 1 manually in all the different collections but there surely must be a better way. Thanks! NJ
4
1200
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) Dim viewCount As Integer If ViewState("viewCount").ToString() = "" Then
1
2594
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 breakdowns for as well as one or more customers. Now, the report iterates through the selected items in the finished good listbox. For each item that it comes across, it calls 4 routines to gather various totals. Each routine will gather a total for...
5
4237
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 from collection base, but use an internal collection, to hold the objects and then implement IEnumerator, see example below,
4
2226
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 the old code allowed me to do what basically was the following assignment: class SomeClass { private Queue q; SomeClass(Queue q)
0
953
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 collections.defaultdict. Any pitfalls to watch out for? It seems we should be able to do slightly better than creating a bag class that has a defaultdict as a member. So, inheriting from defaultdict and
0
1256
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 boxes (at least 1). It seems like a simple extension on the well-known doll concept: A doll may contain a bunch of dolls (possibly 0). whose simple solution is, for example:
4
3997
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 can raise an event and I need the managing class (Devices) to be able to catch these events. Public Class Device Public Event StatusChange()
7
1075
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
9718
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.