Re: Thread always alive

2008-12-01 Thread bdbull

> I am suspecting some kind of a leak on a IO object like a file or socket 
> descriptor is still open.

Are you sure you're closing them all?  You mentioned a finally clause
so is it possible that your code is throwing an exception before you
clean everything up?

--
http://mail.python.org/mailman/listinfo/python-list


Extend Google docs?

2008-10-31 Thread bdbull
Is it possible to extend google docs or create a new project in GAE
and use the google docs editor and all of its functionality?
--
http://mail.python.org/mailman/listinfo/python-list


Re: False and 0 in the same dictionary

2008-11-04 Thread bdbull
On Nov 4, 4:21 pm, Prateek <[EMAIL PROTECTED]> wrote:
> On Nov 5, 1:52 am, Duncan Booth <[EMAIL PROTECTED]> wrote:
>
> > Prateek <[EMAIL PROTECTED]> wrote:
> > > I've been using Python for a while (4 years) so I feel like a moron
> > > writing this post because I think I should know the answer to this
> > > question:
>
> > > How do I make a dictionary which has distinct key-value pairs for 0,
> > > False, 1 and True.
>
> > How about using (x, type(x)) as the key instead of just x?
>
> Yup. I thought of that. Although it seems kinda unpythonic to do so.
> Especially since the dictionary is basically a cache mostly containing
> strings. Adding all the memory overhead for the extra tuples seems
> like a waste just for those four keys.
>
> Is there a better way?
> I also thought of using a custom __eq__  method in a custom class
> which extends the dict type but decided that was even worse.
>
> Prateek

Hmm, my original reply didn't show up.

I'm curious as to what you're trying to accomplish.

Bear in mind that I type this response not knowing your application.
While Python is not a statically typed language, 0 and False are
essentially different types (int and bool).  Storing them both as keys
of a dictionary just doesn't seem like a good design.
--
http://mail.python.org/mailman/listinfo/python-list