How do I DRY the following code?

R. Bernstein rocky at panix.com
Tue Dec 30 11:09:35 CET 2008


"Patrick Mullen" <saluk64007 at gmail.com> writes:
>> f1(...):
>>  "Docstring f1"
>>  c = C()
>>  return c.f1(...)
>>
>> f2(...):
>>  "Docstring f2"
>>  c = C()
>>  return c.f2(...)
>
> Why not just do either this:
> C().f2(..) where you need f2

Yes, this is a little better. Thanks!



More information about the Python-list mailing list