Daniele Esposti's Blog

Python 3 annotations and performances

Python 3 introduced the concept of parameter and return type annotation with PEP 3107. Other interpreted languages supports type annotations for example ActionScript3 and this improved the quality of the generated byte-code and the execution speed because the interpreter can output specialised code for the annotated type. But does is...


Build 64-bit Skia on Mac OS X

It takes me a while to discover how to do it, so I’ll leave this post as a note to myself and to anyone which will have the same need. By default Skia will be build as 32-bit static library under Mac OS X but for who needs to have...


Beware of keyword's default values

Look this class definition, do you see what’s is wrong and potentially generate big problems in you code? class Foo(object): def __init__(self, bars=[]): self.bars = bars <!–more–!> Before jumping straight to the solution lets play with some instances of that class: >>> foo1=Foo([1, 2, 3]) >>> foo2=Foo([3, 4, 5]) >>>...


Parallel data processing

Developing an application or script which process data is a straight-forward pattern: data is collected, processed and the result is provided to be stored in a file or database. Those three blocks (collect, process, store) forms a pipeline and in the old days this pipeline is implemented in a series...


Build PyQt4 into your virtualenv

Here I’ll show the steps to build and install PyQt4 inside a virtualenv. These instructions are related to Mac OS X and Linux systems only. SIP First build and install the SIP binaries: $ cd sip $ python configure.py --incdir=${VIRTUAL_ENV}/include $ make -j2 $ make install The ${VIRTUAL_ENV} environmental variable...