Introducing Web Sockets: Bringing Sockets to the Web
html5rocks.com
html5rocks.com
It gives you the same API as you'd want from a websockets library, but it will fall back to Flash Sockets, long polling, etc. if websockets aren't available.
It was originally written for node, but there's a Python implementation now too.
Of course, I went with Socket.IO - so that covers more than the two of us. Yay!
EDIT: Well, if you're a rubyist. EventMachine does a good job serverside, btw.