Devork - blog.devork.be - devork
General Information:
Latest News:
Inspecting un-imported modules using ast 25 Jun 2012 | 05:21 am
or Skipping modules in py.test using marks but no importing As I've said before, py.test is my favourite testing tool. One if it's features is that it allows you to mark tests with arbitrary "marks"...
Small Emacs tweaks impoving my Python coding 15 Sep 2011 | 12:21 pm
Today I've spent a few minutes tweaking Emacs a little. The result is very simple yet makes a decent impact on usage. Firstly I remembered using the c-subword-mode a long time ago, I couldn't believe...
Using __getattr__ and property 18 Jun 2011 | 06:25 am
Today I wasted a lot of time trying to figure out why a class using both a __getattr__ and a property mysteriously failed. The short version is: Make sure you don't raise an AttributeError in the prop...
Synchronising eventlets and threads 18 Mar 2011 | 06:43 am
Eventlet is an asynchronous network I/O framework which combines an event loop with greenlet-based coroutines to provide a familiar blocking-like API to the developer. One of the reasons I like eventl...
Creating subprocesses in new contracts on Solaris 10 9 Feb 2011 | 01:30 pm
Solaris 10 introduced "contracts" for processes. You can read all about it in the contract(4) manpage but simply put it's a grouping of processes under another ID, and you can "monitor" these groups, ...
re.search() faster then re.match() 20 Dec 2010 | 11:13 am
This is a counter-intuitive discovery, in IPython: So now I'm left wondering why .match() exists at all. Is it really such a common occurrence that it's worth an extra function/method? Just to be co...
Storm and SQLite in-memory databases 2 Nov 2010 | 11:10 am
When using an SQLite in-memory databases in storm the different stores created from the same database are not modifying the same SQLite database. E.g. Here store1 and store2 will not refer to the sam...
Finding the linux thread ID from within python using ctypes 3 Sep 2010 | 12:10 am
So I've got a multi-threaded application and suddenly I notice there's one thread running away and using all CPU. Not good, probably a loop gone wrong. But where? One way to find this is revert histor...
Return inside with statement (updated) 15 Aug 2010 | 06:35 am
Somehow my brain seems to think there's a reason not to return inside a with statement, so rather then doing this: I always do: No idea why nor where I think to have heard/read this. Searching for t...
Templating engine in python stdlib? 10 Aug 2010 | 02:03 am
I am a great proponent of the python standard library, I love having lots of tools in there and hate having to resort to thirdparty libs. This is why I was wondering if there could be a real templatin...