Re: duplicate docstrings

2005-02-19 Thread Felix Wiemann
hings""" def baz(self): """Baz things in a C manner""" class Implementation(Interface): def foo(self): pass def bar(self): pass def baz(self): pass print Implementation.foo.__doc__ print I

Re: sampling items from a nested list

2005-02-17 Thread Felix Wiemann
return_list.append([]) for j in i: if done.setdefault(j[1], 0) in indices[j[1]]: return_list[-1].append(j) done[j[1]] += 1 return return_list -- Felix Wiemann -- http://www.ososo.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Can __new__ prevent __init__ from being called?

2005-02-15 Thread Felix Wiemann
Steven Bethard wrote: > Felix Wiemann wrote: > >> How can I prevent __init__ from being called on the >> already-initialized object? > > The short answer: you can't: > http://www.python.org/2.2.3/descrintro.html#__new__ What a pity. By the way, I'm just

Can __new__ prevent __init__ from being called?

2005-02-15 Thread Felix Wiemann
his checking code in the __init__ method of every subclass. Is there an easier way than using a metaclass and writing a custom __call__ method? -- Felix Wiemann -- http://www.ososo.de/ -- http://mail.python.org/mailman/listinfo/python-list