Re: build a static executable program with python

2004-12-30 Thread Adal Chiriliuc
My app uses Python 2.4 and the Pythonwin GUI (Python MFC wrapper). I build it as a single exe file with everything linked in it. It's a lot smaller than all the DLL's put together. The Python modules are also put into the file as a Win32 resource which contains all the modules bz2 compressed. I ga

Is it ok to type check a boolean argument?

2009-01-07 Thread Adal Chiriliuc
Hello, Me and my colleagues are having an discussion about the best way to code a function (more Pythonic). Here is the offending function: def find(field, order): if not isinstance(order, bool): raise ValueError("order must be a bool") order_by = "asc" if order else "desc" r

Re: Is it ok to type check a boolean argument?

2009-01-07 Thread Adal Chiriliuc
On Jan 7, 10:15 pm, Bruno Desthuilliers wrote: > This being said, I can only concur with other posters here about the > very poor naming. As far as I'm concerned, I'd either keep the argument > as a boolean but rename it "ascending" (and use a default True value), > or keep the 'order' name but th