[IPython-dev] ipipe news
walter at livinglogic.de
Wed Mar 8 12:37:51 CST 2006
Torsten Marek wrote:
> Fernando Perez schrieb:
>> Walter Dörwald wrote:
>>> 3) Pass a dictionary that contains all the attributes from the list.
>>> This has the disadvantage that (for iwalk etc.) there will be many
>>> os.stat() calls, even if the result is never used (and you can't
>>> reference attributes that are not in the field list).
>>> BTW, the reason why you got an empty browser was, because ifilter
>>> ignores all objects where evaluating the expression raises and
>>> Exception. And then the expression for isort never fails, because
>>> there's nothing left to sort.
>>> Anyway, IMHO we should implement 2) and document the possibility to
>>> directly reference attributes as a "2.4 goodie".
>> That sounds like a good plan. 2.3 compatibility is important because a large
>> number of installed users still have that (Mac OSX and the 'enterprise'
>> versions of RedHat, amongst others) in their 'out of the box' configs. But
>> it's OK if a few extra conveniences are only available for 2.4 when they they
>> can't be implemented in a backport, as long as the basic functionality (like
>> the example in the docstring :) work with 2.3.
> here's a patch for ipipe that works around the shortcomings of Python 2.3. I
> don't know whether is satisfies the constraint in 3,
It does. Only the attributes mentioned in the expression are copied. But
of course evil expressions like ifilter("locals()['value'] is not None")
won't work, because the attribute is only referenced indirectly.
Nevertheless it's still better than only supporting "_".
> but it works for the
> examples mentioned here on the list.
The patch looks good to me (But the comments and docstrings should be
updated of course).
More information about the IPython-dev