All posts
-
Read more >
And now for something completely different
My friend Yuval whom you might already know from the comments here, apparently composed music for the Python Zen. It made me laugh today, and as it’s been a long day, I thought it’s worth sharing here. Especially as it is Python related.
-
Read more >
Leaky method references
After reading my last post regarding __del__, you should know that __del__ + reference cycle = leak. Let’s say that you do need to use __del__, so you decide to avoid reference cycles. You write your code in such a way as to use the minimum necessary cycles, and for the ones that remain you…
-
Read more >
Python Gotchas No. 2: Garbage Collection Oddities
Python is a garbage collected language. The garbage collector will collect orphaned objects. These are objects that have no references. If an object has a __del__ method, it will be called when that object is collected. Note however, that there are no guarantees as to when this will take place. This means that while you…
-
Read more >
PyWeb-IL presentation: Advanced subjects in Python
Yesterday I gave a presentation at PyWeb-IL, which took place at Google’s offices in Tel-Aviv. The presentation went really well, and interested many people. Here are the slides for the presentation, “Advanced Python Subjects”.
-
Read more >
PythonTurtle delivers!
A few days ago, a coworker asked me what tool he should use to teach another non-programming coworker some programming. I thought a little, and suggested PythonTurtle, and then also demonstrated the builtin turtle. I thought nothing much of it, but a few days later, when I entered his office, the non-programming coworker was sitting…
-
Read more >
Python Gotchas 1: __del__ is not the opposite of __init__
After discussing my last post with a friend and talking about a few other issues, we came to the conclusion that it would be worthwhile to discuss more gotchas. First though, what is a gotcha? Wikipedia gives a good definition: In programming, a gotcha is a feature of a system, a program or a programming…
-
Read more >
GeneratorExit: another reason to upgrade to Python 2.6
Ever heard of GeneratorExit? Unless you write generators, and do some unusual stuff with them, you probably haven’t encountered it. GeneratorExit is a special exception that gets raised from within a generator when it is close()-ed. For example, consider the following code: def func(): f = file(’temp.txt’,’w’) for i in range(10): f.write(’%d\n’ % i) yield…
-
Read more >
Fast Peak Autocorrelation
So, I was at geekcon. It was a blast. There were many interesting projects, and I didn’t get to play with them all. I did get to work a bit on the Lunar Lander from last year, and this year it was finished successfully. My part was the PC game which interfaced with the microcontroller…
-
Read more >
Preparing PyImprov for GeekCon on Friday
A long long time ago, I wrote Pytuner. It was one of the first projects I published on this website. For a long time it just sat there, doing nothing, while the library it’s based on – PyMedia, wasn’t being maintained anymore, and PyTuner could only work on Python 2.4. Enter GeekCon – GeekCon is…
-
Read more >
My Startup – Plnnr.com
I’ve been waiting for this blog post for more than a year now. This is my startup, Plnnr.com. If you want, go there first, form an opinion, and then get back here, I’ll wait :) As you can tell, plnnr.com is an automatic trip planner – it saves you a lot of the trouble and…