[IPython-dev] IPython traitlet problem

MinRK benjaminrk@gmail....
Sun Apr 21 16:54:23 CDT 2013


The only reason I can see for not allowing `*args` would be preserving a
Traits behavior, but if this isn't how Traits behaves, then there's really
no reason not to fix it <https://github.com/ipython/ipython/pull/3205>.



On Sun, Apr 21, 2013 at 12:26 PM, Robert McGibbon <rmcgibbo@gmail.com>wrote:

> I would be +1 on allowing position arguments to the constructor, if its
> that easy.
> This feature/bug has bitten me before, which is why I remembered that error
> message.
>
> In general, with traitlets, you really end up moving a lot of logic out of
> the __init__
> method, and into _X_changed or _X_default, so it doesn't end up being that
> important.
>
> -Robert
>
> On Apr 21, 2013, at 6:17 AM, Robert Kern wrote:
>
> > On 2013-04-21 16:43, Thomas Kluyver wrote:
> >> For what it's worth, Python 3 introduces keyword-only arguments, which
> can be
> >> required arguments. That's specified as part of the function signature,
> though;
> >> I agree that this limitation in traitlets isn't ideal.
> >
> > It's relatively easily fixed. Just include *args in the __new__() and
> __init__()
> > and ignore them.
> >
> > I don't recall, but this might have been an explicit design choice for
> traitlets
> > in order to force the use of keyword arguments exclusively. It is a
> deviation
> > from Traits behavior.
> >
> > --
> > Robert Kern
> >
> > "I have come to believe that the whole world is an enigma, a harmless
> enigma
> >  that is made terrible by our own mad attempt to interpret it as though
> it had
> >  an underlying truth."
> >   -- Umberto Eco
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev@scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20130421/8f98382f/attachment.html 


More information about the IPython-dev mailing list