Re: Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread horizon5
Interesting replies, thank you all. Since the language defines the bahviour, I'm all for using it (when appropriate). > there is no distinction between seq is None on the one hand and seq > being a valid empty sequence on the other hand. > > I feel that that is an import distinction, and it's the

Relying on the behaviour of empty container in conditional statements

2006-07-11 Thread horizon5
Hi, my collegues and I recently held a coding style review. All of the code we produced is used in house on a commerical project. One of the minor issues I raised was the common idiom of specifing: if len(x) > 0: do_something() Instead of using the language-defined bahviour, as stated by PE