April 10, 2009 – 12:46 pm
There’s a bit of buzz on the python-ideas mailing list about Greg Ewing’s proposal for a new keyword “yield from“. He has made a draft PEP and patch for python 2.6.1.
On short it adds syntactic sugar for generator decomposition and adds a “return value” statement in generators (the underlying mechanism for that is a StopIteration(value) [...]
January 19, 2009 – 12:56 am
I was playing these days with greenlets and I finally managed to find some time to make and coroutine implementation for cogen that uses the seamless stack switching of greenlets instead of the usual generator yield-based switching.
The best part about this is that cogen could support any sort of old code that uses the usual [...]
November 29, 2008 – 1:45 am
I’ve finally mannaged to pull off a set of wrappers for using the raw windows iocp api using ctypes, namely wrappers for GetQueuedCompletionStatus, WSARecv, WSASend, AcceptEx, ConnectEx, TransmitFile and the whatever structs and utility calls they need.
Writing the wrappers wasn’t that hard – but if you aren’t careful with ctypes you are in a world [...]
November 29, 2008 – 1:24 am
There are a bunch of solutions for making a bridge to use the flash sockets (flash.net.Socket) in javascript, notably socketBridge and jssockets. But I didn’t like the way they made you write your client code: because you can’t pass javascript function references through the ExternalInterface you usually pass your callbacks as strings representing the name [...]
November 3, 2008 – 10:36 pm
It’s interesting that having “dev” version packages in the install_requires list will fail.
Say for example, if you do:
from setuptools import setup
setup(
…
install_requires=["Pylons==dev"],
…
)
It won’t work:
Installed d:\python25\lib\site-packages\pylons-0.9.7rc3dev_20081103-py2.5.egg
Reading http://www.pylonshq.com/download/0.9.7
error: Could not find required distribution Pylons==dev
I imagine it would match if the package would literally have the version “dev”.
One solution is to change the install_requires to ["Pylons==dev,!=foo"] or some other [...]
October 26, 2008 – 12:51 am
I didn’t knew that till i’ve read Ian’s post on decora-descriptors (I guess I can call them that). Actually it’s explained in more details here.
On short, functions have the __get__ method that make them work as descriptors when they are in a class.
I can do this:
>>> class Bar:
… pass
…
>>> bar = [...]
September 23, 2008 – 1:34 am
Quitter’s journal: After trying for half of week of getting some stuff going on appengine here is what I observed.
The runtime is completely different. They do try however to patch the normal python runtime in the sdk to have the same characteristics as the runtime on their servers but differences fall through the cracks. The [...]
September 15, 2008 – 8:03 am
The major refactor of the socket stuff is finally in the trunk. The Socket is more in line with the standard socket module in python (there’s a makefile and a _fileobject for readline just like the standard library). And it looks like performance is still pretty good.
The only things I can think of right now [...]
September 1, 2008 – 10:01 pm
Google’s shiny new browser is almost here: Google Chrome based on WebKit.
Featuring a sandbox model for tabs (tough I hope that sandbox will not be a complete process – as some speculate) and a “V8″ javascript engine – according to Joshua “code is instantly interpreted into machine code”. Damn, where did he knew that ? [...]
August 16, 2008 – 5:25 pm
I’ve added a manage bindings dialog and other minor improvements. Grab the userscript from http://userscripts.org/users/62351/scripts