Ask Your Question

Set vs set

asked 2012-11-08 08:42:47 -0500

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

answered 2012-11-08 08:51:06 -0500

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


Thanks @John Palmieri, yes I have another question related to this, posted here:

SLOtoSF gravatar imageSLOtoSF ( 2012-11-08 19:32:14 -0500 )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


Asked: 2012-11-08 08:42:47 -0500

Seen: 112 times

Last updated: Nov 08 '12