At Wednesday 27/12/2006 23:55, Gian Mario Tagliaretti wrote:

class One(object):
    def __init__(self):
        whatever

don't forget to call __init__ on new style classes otherwise you can pass
arbitrary arguments when instantiating the class e.g.:

one = One(a, b)

but python will silently ignore them and you probably won't like it...

I don't understand what you say here.

>>> class One(object): pass
...
>>> a = One(1,2)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: default __new__ takes no parameters

How do you make Python silently ignore the arguments?


--
Gabriel Genellina
Softlab SRL

        

        
                
__________________________________________________ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yahoo.com.ar/respuestas
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to