[IPython-dev] IPython development news and prospects

Fernando Perez fperez.net at gmail.com
Wed Jan 16 01:22:10 EST 2008

On Jan 15, 2008 10:20 PM, Prabhu Ramachandran <prabhu at aero.iitb.ac.in> wrote:
> Fernando Perez wrote:
> [...]
> > The idea is to write a very lightweight, Traits-like module that does
> > only a fraction of what Traits does, but does so with 100% api
> > compatibility within that subset.  Basically we'd only implement
> [...]
> IMNSHO, I think this is a step in the wrong direction!  Do you really
> have that much time on your hands?  How are you going to maintain b/w
> compat?  What about new versions/new features, tests, bugs?  An option
> would be to request Dave Morrill to see if this could be done in traits.
>   Kind of like elementtree/celementtree.

I'm not sure it would take that much time: keep in mind I'm not
talking about implementing all of traits, but only:

1. Validation on assignment for a handful of basic, builtin types
(strings, numbers, lists).
2. Callback registration.

That's it.  It doesn't matter what new features the real Traits gets,
since we're not implementing those at all.

I'm a huge admirer of Traits, and would love to have it be *in the
language* so we could use all of its features for all  code (and so
that it was considered high-priority enough that the Jython/IronPython
people would implement its API on top of their own backends).  But the
reality today is that it's not in the core, and so we have to weigh
its cost against its benefits in the core.

I'm unfortunately in the middle of a packing/job change/cross country
move so I doubt I'll be able to prototype this quickly, but I honestly
don't think it's that hard at all.  Much of the really difficult work
in Traits has to do with a very rich API, GUI code, and a tight C
implementation for performance.  But just having validation and
callbacks is something that Python properties already almost do, and I
honestly don't see it being all  that hard.



More information about the IPython-dev mailing list