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. > "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. > 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.