Run dynamic generated Python code safely

We’ve developed this to be able to run trusted methods as batch operations that were saved into database to be performed later on. The code is easy to understand reading its tests: Tests: Check out this file Code: import os import inspect import inspect class...

Optional arguments are evil

When it comes to version and API changes, Python optional arguments are evil. Say you define a function like this: def someFunction(param1, param2, optParam=None) # code And you are calling it from module whatever.py like this: retValue = someFunction(x, y, z) A few...

Catch the exception and throw it again

Same behavior in Python and C#… Wrong code: try: # some code except Exception, e: # log the exception or whatever raise e Right code: try: # some code except Exception, e: # log the exception or whatever raise # JUST RAISE!!! Wrong code: try { // whatever }...

Continuous Integration on Python

Hudson and Cruise Control are very popular among Java/.Net developers but when it comes to Python, … Hudson also seems to work on python!. Open source tools for Python continuous integration: Hudson Buildbot Bitten However, I just want a simple way to check out...

A bunch of cool links

What I’ve got browsing today: REST Explained Web services VS REST Free book: Scrum and XP from the Trenches. Traducido al castellano tambien!!!!: Proyectalis.com

Pensando en Generics

Dar el salto a los generics de .Net 2.0 supone un cambio en la forma de pensar. Como dicen en inglés, un “mind shift”. En este artículo voy a tratar de explicar los generics mediante reglas que hagan fácil el proceso de detectar cúando se pueden usar y de...