Help with Asyncore
Hello, I am using Asyncore.dispatcher around a socket (well call the wrapped version a channel). This channel is passed around to other objects. These objects call "send" on the channel. My question is, what do you do for "writable" and "handle_write"? Those seemed designed for channel-internal buffers. Should I also overwrite "send" and have the data appended to a buffer? If not, how should writable and handle_write be implemented? I'm not sure what to do here... Thank you in advance, -- Seth Nielson -- http://mail.python.org/mailman/listinfo/python-list
Re: A replacement for lambda
I understand that there are a number of people who wish to remove lambda entirely from the language. Nevertheless, I find it a useful and powerful tool in actual development. Any replacement must support the following: *delayed evaluation*. I need a convenient (def is not always convenient) way of saying, "don't do this now". That is why I use lambda. -- Seth Nielson On 7/30/05, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: > Stefan Rank wrote: > > on 30.07.2005 10:20 Paolino said the following: > >> why (x**2 with(x))<(x**3 with(x)) is not taken in consideration? > >> > >> If 'with' must be there (and substitue 'lambda:') then at least the > >> syntax is clear.IMO Ruby syntax is also clear. > >> > > > > I am sorry if this has already been proposed (I am sure it has). > > > > Why not substitue python-lambdas with degenerated generator expressions:: > > > >(lambda x: func(x)) == (func(x) for x) > > > > i.e. a one time callable generator expression (missing the `in` part). > > The arguments get passed into the generator, I am sure that can be > > combined with the PEP about passing args and Exceptions into a generator. > > It's hard to spot, and it's too different to a genexp to have such a similar > syntax. > > Reinhold > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list
gdbm dying wierdly
Hi guys. I'm using a python script as a redirector for Squid. My python script uses gdbm and exhibits some weird behavior. 1. If I run the script stand-alone, it loads the gdbm database file just fine. 2. If the script is launched from squid, when it tries to load the gdbm database, it dies WITHOUT an exception! It just disappears! (signal maybe?) Please help! I'm up against the wall! -- Seth N. -- http://mail.python.org/mailman/listinfo/python-list
Re: gdbm dying wierdly
Nevermind. The problem wasn't in gdbm. I had "exception" in stead of "Exception" in the try-except statement. -- SethNOn 8/27/05, Seth Nielson <[EMAIL PROTECTED]> wrote: Hi guys. I'm using a python script as a redirector for Squid. My python script uses gdbm and exhibits some weird behavior. 1. If I run the script stand-alone, it loads the gdbm database file just fine. 2. If the script is launched from squid, when it tries to load the gdbm database, it dies WITHOUT an exception! It just disappears! (signal maybe?) Please help! I'm up against the wall! -- Seth N. -- http://mail.python.org/mailman/listinfo/python-list