Ask Your Question
0

Set vs set

asked 2012-11-08 15:42:47 +0100

SLOtoSF gravatar image

I am trying to create a class deriving from set or Set because I would like to tack on various attributes to this set based on its elements.

What is the best way to do this? What is the difference between Set and set?

I've posted another question asking how to make a ring of sets.

I understand how to make a ring, but when I try to make a Ring Element I get a base class issue.

Any help in this area is appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-11-08 15:51:06 +0100

set is a Python class while Set is a Sage class. The documentation for Set says

If X is a list, tuple, Python set, or "X.is_finite()" is true, this returns a wrapper around Python's enumerated immutable frozenset type with extra functionality. Otherwise it returns a more formal wrapper.

If you need the functionality of mutable sets, use Python's builtin set type.

What questions do you have after reading this?

edit flag offensive delete link more

Comments

Thanks @John Palmieri, yes I have another question related to this, posted here: http://ask.sagemath.org/question/1948/constructing-a-ring-of-sets

SLOtoSF gravatar imageSLOtoSF ( 2012-11-09 02:32:14 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-11-08 15:42:47 +0100

Seen: 1,048 times

Last updated: Nov 08 '12