Class name as argument

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon May 14 23:06:20 EDT 2007


En Mon, 14 May 2007 19:34:52 -0300, HMS Surprise <john at datavoiceint.com>  
escribió:

> Snippet 1 below doesn't do much but works (more code is inserted by a
> generator). In the next to last line the class name is also used as
> argument. I have seen this construct before and have had error
> messages tell me that the name is expected. Why is this so? In snippet
> 2 that I concocted is not required. Is it related to __init__ perhaps?

The arguments are those expected by the class constructor: __new__, and  
initializer: __init__.
It's up to the class designer to define which arguments are required -if  
any- and which ones are optional -if any-.
In your case, see the documentation for PyHttpTestCase.

-- 
Gabriel Genellina




More information about the Python-list mailing list