En Fri, 04 Apr 2008 18:08:57 -0300, <[EMAIL PROTECTED]> escribió:
>> b) Define a function to extract a "key" from your items such that items
>>
>> compare the same as their keys. For example, key(x) -> x.lower() may be
>>
>> used to compare text case-insensitively.
>> Then, use a tuple (ke
>
> b) Define a function to extract a "key" from your items such that items
> compare the same as their keys. For example, key(x) -> x.lower() may be
> used to compare text case-insensitively.
> Then, use a tuple (key, value) instead of the bare value. When extracting
> items from the queue,
Thanks Gabriel
--
http://mail.python.org/mailman/listinfo/python-list
En Thu, 03 Apr 2008 19:21:19 -0300, <[EMAIL PROTECTED]> escribió:
> On Apr 3, 4:24 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
>> <[EMAIL PROTECTED]> wrote in message
>>
>> news:[EMAIL PROTECTED]
>> |I am week on functional programming, and having hard time
>> | understanding this:
>> |
>> | clas
On Apr 3, 5:43 pm, John Machin <[EMAIL PROTECTED]> wrote:
> On Apr 4, 9:21 am, [EMAIL PROTECTED] wrote:
>
>
>
>
>
> > On Apr 3, 4:24 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
>
> > > <[EMAIL PROTECTED]> wrote in message
>
> > >news:[EMAIL PROTECTED]
> > > |I am week on functional programming, an
On Apr 4, 9:21 am, [EMAIL PROTECTED] wrote:
> On Apr 3, 4:24 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
>
> > <[EMAIL PROTECTED]> wrote in message
>
> >news:[EMAIL PROTECTED]
> > |I am week on functional programming, and having hard time
> > | understanding this:
> > |
> > | class myP
On Apr 3, 4:24 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> <[EMAIL PROTECTED]> wrote in message
>
> news:[EMAIL PROTECTED]
> |I am week on functional programming, and having hard time
> | understanding this:
> |
> | class myPriorityQueue:
> | def __init__(self, f=lamda x:x):
> |
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
|I am week on functional programming, and having hard time
| understanding this:
|
| class myPriorityQueue:
| def __init__(self, f=lamda x:x):
| self.A = []
| self.f = f
|
| def append(self, item)
|
I am week on functional programming, and having hard time
understanding this:
class myPriorityQueue:
def __init__(self, f=lamda x:x):
self.A = []
self.f = f
def append(self, item)
bisect.insort(self.A, (self.f(item), item))
n