Unfortunately, few things are perfect. I'll leave it to someone else to tell me I'm wrong (or right?) here, but the following seems less than ideal:

sage: a = int('1')

sage: b = Integer('1')

sage: a == b

True

sage: type(a) == type(b)

False

I love Sage, so maybe I'll come back to this later when I have more time. Right now, I think that if type(a) is contained in type(b) *and* a == b, then type(a) == type(b) should return true. But this brings up interesting questions about what are types ... I'll edit this entry more later once I've read up on more type theory, more category theory, and sage/python type handling design (this could be a while!).

## Wednesday, July 23, 2008

### Equality of elements should imply equality of types

Labels:
category theory,
python,
python types,
SAGE,
type theory

Subscribe to:
Post Comments (Atom)

## No comments:

Post a Comment