[IPython-dev] IPython1 API design question

Brian Granger ellisonbg.net@gmail....
Sat Feb 9 17:57:28 CST 2008


> what about an approach where you extract the reserved keywords manually?
> something like

We seriously considered this option, but rejected it for two reasons

1.  IPython1 is heavily based on interfaces (as in zope.interface).
Using this trick sort of makes all your interfaces to vague to be
useful.

2.  In most of the cases we were using **kwargs, there is nothing to
prevent the user from trying to use keyword arguments for their own
purposes.  That is we could never know if block/targets should be
interpreted as internal ipython keyword arguments or ones that should
simply be passed on.  This would lead to confusing wierd bugs.

Brian

> def push(self,**kargs):
>  ns = kargs.copy()
>  block = ns.pop('block', False)
>  targest = ns.pop('targets', 'all')
>  ...
>
> kilian
>


More information about the IPython-dev mailing list