Le dimanche 05 juin 2011 à 06:13 -0700, Vinzent Steinberg a écrit :
> On 4 Jun., 18:24, Ronan Lamy <ronan.l...@gmail.com> wrote:
> > No, it shouldn't, because ZZ isn't a set. That's indeed the problem with
> > using the name of an abstract mathematical set to designate a concrete
> > type.
> 
> If I understand it correctly, ZZ is the implementation of the ring of
> integers, so mathematically it is nothing but a set with some special
> elements and a few mappings, satisfying some axioms. For convenience,
> you refer to the set only, even if you mean the ring. So I think the
> implementation is fine.
> 
Your understanding seems to contradict Aaron's. ZZ can't be
simultaneously a proxy for a concrete type and a representation of an an
abstract mathematical concept.

> > "Symbol('n', integer=True) in ZZ" looks like something that should
> > obviously be True, but actually it doesn't make sense.
> 
> Well, in polys this would be rather ZZ[n], because ZZ means concrete
> integers and not symbolic ones.

But we need symbolic integers if we want to do any symbolic manipulation
on integers. In the main core, there's .is_integer and .is_Integer, they
are different and we need both. Why change the rules in the polynomial
core?

> > So 'isinstance(a,
> > int_type)' isn't just more readable, it also prevents dangerous
> > misunderstandings.
> 
> > BTW, ZZ.__contains__ does exist and does something different from
> > ZZ.of_type.
> 
> The difference is subtle, ZZ.__contains__ tries to convert the type,
> but ZZ.of_type only checks the type. It is like '==' vs. 'is'.
> 
> Vinzent
> 


-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to