[IPython-dev] [nbconvert] Reining in the number of constructor arguments
Fri Nov 30 18:26:17 CST 2012
On Fri, Nov 30, 2012 at 6:44 PM, Thomas Kluyver <email@example.com> wrote:
> On 30 November 2012 23:05, David Warde-Farley <firstname.lastname@example.org>
>> I'm wondering how to solve (and how you guys think I should solve) a
>> certain problem I foresee, of a potentially rapidly growing number of
>> constructor arguments for Converter classes, which need to be
>> maintained across constructors in order to keep the front-end calling
>> code generic (one could use *args and **kwargs catch-alls but that's
>> pretty ugly).
> I may be barking up the wrong tree, but instead of constructor arguments,
> would it make sense to simply set attributes on the converter, e.g.
> conv = HTMLConverter()
> conv.highlight_source = False
Somehow, I didn't think of this. This is fairly elegant. I'll have to
think about this in a background thread over dinner.
More information about the IPython-dev