Am I doing something wrong in the session below?

I admit that I do not understand python types and methods yet.  When
can I apply the functional notation, when the method notation?  It
seems that it's not a language thing, because they often return
different things.  As another example, Mod(5,3) and mod(5,3) seem to
agree, while 5.mod(3) is different and 5.Mod(3) is an error.

Is a method responsible for checking whether it's arguments are ofthe
right type/parent, or  is there a possibility to restrict the
arguments to a given type/parent?

Martin

sage: reset()
sage: R=Set(range(0,20,2))
sage: R
{0, 2, 4, 6, 8, 10, 12, 14, 16, 18}
sage: R.type()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call
last)

/home/rubey/<ipython console> in <module>()

AttributeError: 'Set_object_enumerated' object has no attribute 'type'
sage: R.parent()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call
last)

/home/rubey/<ipython console> in <module>()

AttributeError: 'Set_object_enumerated' object has no attribute
'parent'
sage: type(R)
<class 'sage.sets.set.Set_object_enumerated'>
sage: parent(R)
<class 'sage.sets.set.Set_object_enumerated'>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to