Hi Florent!

On 2012-03-28, Florent Hivert <florent.hiv...@lri.fr> wrote:
>> For parameter-less categories like Fields, I don't have a feeling for
>> whether one should teach new users to use the idiom ``X in Fields`` or
>> ``X in Fields()``. I tend to use the later mysefl.
>
> Speed could be a (not so important) argument. 

Not so important??? I take speed very seriously. And by the way, testing
containment is even faster if you assign Fields() to a
constant, e.g.

  sage: FieldsCat = Fields()
  sage: QQ in Fields
  True
  sage: QQ in FieldsCat
  True
  sage: %timeit QQ in Fields
  625 loops, best of 3: 11.4 µs per loop
  sage: %timeit QQ in Fields()
  625 loops, best of 3: 4.14 µs per loop
  sage: %timeit QQ in FieldsCat
  625 loops, best of 3: 1.86 µs per loop

Cheers,
Simon

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to