i know it's not very hard to get that solution.
just by implementing simple function like below.
def partition(target, predicate):
"""
split a list into two partitions with a predicate
provided.
any better ideas? :)
"""
true = []
On 12월14일, 오후12시42분, Steven D'Aprano
wrote:
> On Sun, 13 Dec 2009 17:19:17 -0800, knifenomad wrote:
> > this makes the set type hashable.
>
> > class Set(set):
> > __hash__ = lambda self: id(self)
>
> That's a *seriously* broken hash function.
>
On 12월14일, 오전10시19분, knifenomad wrote:
> On 12월14일, 오전2시57분, mattia wrote:
>
>
>
>
>
> > Il Sun, 13 Dec 2009 16:37:20 +, mattia ha scritto:
>
> > > How can I insert non-duplicate data in a list? I mean, is there a
> > > particular option in the
On 12월14일, 오전2시57분, mattia wrote:
> Il Sun, 13 Dec 2009 16:37:20 +, mattia ha scritto:
>
> > How can I insert non-duplicate data in a list? I mean, is there a
> > particular option in the creation of a list that permit me not to use
> > something like:
> > def append_unique(l, val):
> > if