On Sun, Nov 28, 2010 at 01:53:21AM -0600, alex goretoy wrote:
> wow, thank you. This is exactly what I was looking for :)
> 
>     def get_treestore(n=1):
>         if n:
>             return gtk.TreeStore(*((str,) * n))
>         return gtk.TreeStore(str)

usually I prefer do not check for function parameters.
who is calling `get_treestore`? if the input come from the user I prefer
check the input and then call, or not, the function. if the input come
from a computation, a wrong value is a bug in the program that need to
be fixed. just if I want to be sure I add an `assert` statement.

m.

-- 
Excellentium virorum est improborum negligere contumeliam,
a quibus etiam laudari turpe.
                -- Plutarco
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to