Friday, February 18, 2005

Jython and numeric directory names and a segue into aspiration mode

I want to import Python code from a module. No problem. In Jython, you add the directory name to python.path in your registry, create the all important __init__.py file and your done.

Works great. Except when the directory name is numeric. Then the import fails.

It took me an hour to track the problem down as I assumed the problem was in the __init__.py or other machinery. It never occured to me that the directory name would be the nub of the problem.

This universe has countless zillions of programmer hours spent diagnosing problems like this.

By writing this one down I am doing my teeny weeny bit for progress. I aim to fractionally increase the chances of somebody else with the same problem getting a Google search hit before they spend the hour I just spent.

If we all do this kind of thing every day - factor it into our daily routines - the benefits will be disproportionatly positive for this profession and its ability to debug not only code, but itself.

No comments: