Archive for May, 2009

Dear Bastien, I’ll be waiting for you to organize FreeFA

Thursday, May 28th, 2009

My dear French Colleague Bastien (FCB? Wait, what? Is he hiding something?), I’m glad to accept a bet that I have (and had even before the game) already won.

Anyone interested in FreeFA (our annual soccer match) keep an eye on Bastien’s blog, he will be organizing it :-)

Python common mistakes

Saturday, May 23rd, 2009

When starting with Python or just when you haven’t read PEP 8 you usually fall into some frequent mistakes. Mostly because you take your experience in other languages to Python and your mind gets confused with the new conventions (or something like that).

Some of these errors and their explanation:

  • if a == None:
    Really common. None is a singleton, so you can (well, actually, have) to compare to it like ‘if a is None‘ or ‘if a is not None‘.
  • if (condition):
    This is not really pythonic, if doesn’t take () around the condition in python, () purpose is grouping, you can use them in an if but only to clarify a really complex condition or similar stuff. Please don’t clutter code with unneeded characters.
  • if len(list):
    This is a misunderstanding of Python way of things, any empty sequence (string, list, tuple) is False. So if you want to make sure a list is empty, just check if it’s False. Same for tuples, and in some ocassions for strings.
  • if type(obj) is type(1):
    This is killing kittens, there’s a builtin function for this purpose, it’s called -surprise- isinstance(object, type). For example isinstance(123, int)

Read more about this and other conventions in PEP 8.

Still locked out of Google

Monday, May 11th, 2009

Google continues to lock me out of my account apparently just for fun. NOT A SINGLE ANSWER I have got from their bazillion of forms.

I’m obviously pissed off by this, so far the best I have got have been automated replies from forms spitting standard answers to me, answers also in the GMail web help. Yes, that kind of answer “please check that the router is ON”.

Google: you are making me unhappy, I have been happy to recommend you to friends, but doesn’t seem like I will keep doing it after this.

I have bazillions of stuff rotting in queue because of this.

Locked out of Google world

Tuesday, May 5th, 2009

So, seems like Google locked me out of my account today. Apparently for my own protection. Perhaps they are right and they are preventing me from being harmed.

In case you sent me a million dollar offer or something really important, this is why I haven’t replied.

Sigh.