On 04/03/2014 00:52, Itamar Turner-Trauring wrote:
On 03/03/2014 01:09 PM, Adi Roiban wrote:

What do you think? Should I go ahead and add options as __init__
arguments or think of a configuration system?


A configuration system would take a while to design and meanwhile these
unrelated features would languish, so I'd suggest you start with options
to __init__.

-1

I hate __init__ methods with a hojillion parameters, and that's where this leads.

+1 instead for class variables which can be overridden in sub-classes to achieve DRY and/or set after instantiation if necessary e.g.

class Foo:
  maxThingLen = 10000

class MyFoo(Foo):
  maxThingLen = 100

This is also somewhat consistent with what things like t.w.s.Site already do.

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to