[IPython-dev] [nbconvert] Reining in the number of constructor arguments

David Warde-Farley d.warde.farley@gmail....
Fri Nov 30 18:26:17 CST 2012


On Fri, Nov 30, 2012 at 6:44 PM, Thomas Kluyver <takowl@gmail.com> wrote:
> On 30 November 2012 23:05, David Warde-Farley <d.warde.farley@gmail.com>
> wrote:
>>
>> 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.

Thanks,

David


More information about the IPython-dev mailing list