On May 20, 2010, at 10:35 AM, Martin v. Löwis wrote:
>> I think it'd be useful enough to go in the standard library. Now that
>> there's a sample implementation, should I still try to demonstrate why I
>> believe it's worth adding to the stdlib and get support?
>
> Most definitely. Just in case
Martin said:
> Most definitely. Just in case it isn't clear: nobody else seems to think
> this is useful (let alone useful enough to go into the standard
> library). In addition, it's trivial to implement, more reason not to add
> it.
Yeah, fair enough. Thanks for your responses! :)
--
Gustavo Na
> I think it'd be useful enough to go in the standard library. Now that
> there's a sample implementation, should I still try to demonstrate why I
> believe it's worth adding to the stdlib and get support?
Most definitely. Just in case it isn't clear: nobody else seems to think
this is useful (let
On 20/05/2010 17:02, geremy condra wrote:
On Wed, May 19, 2010 at 1:56 AM, Gustavo Narea wrote:
Hello, Oleg.
class UnorderedList(list):
def __eq__(self, other):
if not isinstance(other, UnorderedList):
return False
return sorted(self) == sorted(other)
On Wed, May 19, 2010 at 1:56 AM, Gustavo Narea wrote:
> Hello, Oleg.
>
>>
>> class UnorderedList(list):
>> def __eq__(self, other):
>> if not isinstance(other, UnorderedList):
>> return False
>> return sorted(self) == sorted(other)
>>
>> def __ne__(self, other):
>>
On Thu, 20 May 2010 08:40:25 pm Oleg Broytman wrote:
> On Wed, May 19, 2010 at 09:56:03AM +0100, Gustavo Narea wrote:
> > I think it'd be useful enough to go in the standard library. Now
> > that there's a sample implementation, should I still try to
> > demonstrate why I believe it's worth adding
On Wed, May 19, 2010 at 09:56:03AM +0100, Gustavo Narea wrote:
> I think it'd be useful enough to go in the standard library. Now that
> there's a sample implementation, should I still try to demonstrate why I
> believe it's worth adding to the stdlib and get support?
I think yes. How many deve
Hello, Oleg.
> class UnorderedList(list):
>def __eq__(self, other):
>if not isinstance(other, UnorderedList):
>return False
>return sorted(self) == sorted(other)
>
>def __ne__(self, other):
>return not self.__eq__(other)
>
> Do you need more than that
Hi, Guido.
On Wed, May 19, 2010 at 12:11 AM, Guido van Rossum wrote:
> This is typically called a "bag". Maybe searching for that will help
> you find a recipe?
>
A bag/multiset is close to what I need, except for one thing: I need to
iterate over the elements in the original order, not in a ra
Gustavo Narea writes:
> I've been searching for a data structure like a tuple/list *but*
> unordered -- like a set, but duplicated elements shouldn't be removed.
By that description, you're looking for the “Bag” pattern.
[…]
> A multiset is not exactly what I need: I still need to use the
> ele
On Tue, May 18, 2010 at 11:13:42PM +0100, Gustavo Narea wrote:
> To sum up, it would behave like a tuple or a list, except when it's compared
> with another object: They would be equivalent if they're both unordered
> tuples/lists, and have the same elements. There can be mutable and immutable
>
On Wed, 19 May 2010 08:13:42 am Gustavo Narea wrote:
> Hello, everybody.
>
> I've been searching for a data structure like a tuple/list *but*
> unordered -- like a set, but duplicated elements shouldn't be
> removed. I have not even found a recipe, so I'd like to write an
> implementation and contr
2010/5/18 Guido van Rossum :
> This is typically called a "bag". Maybe searching for that will help
> you find a recipe?
Yes, and we have one in Python 2.7+ called collections.Counter.
--
Regards,
Benjamin
___
Python-Dev mailing list
Python-Dev@python
This is typically called a "bag". Maybe searching for that will help
you find a recipe?
On Tue, May 18, 2010 at 3:13 PM, Gustavo Narea wrote:
> Hello, everybody.
>
> I've been searching for a data structure like a tuple/list *but* unordered --
> like a set, but duplicated elements shouldn't be re
Hello, everybody.
I've been searching for a data structure like a tuple/list *but* unordered --
like a set, but duplicated elements shouldn't be removed. I have not even
found a recipe, so I'd like to write an implementation and contribute it to
the "collections" module in the standard library.
15 matches
Mail list logo