New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Casting a standard tableau as a tableau #14260
Comments
comment:1
This just comes from
and before trying to construct a tableau from some input this is tested... I wouldn't consider this a bug but more a feature: a standard tableau has all features of a tableau, plus extra. So for Sage users, I think this is the desired behaviour... |
comment:2
This is the desired and correct behavior. Elements (such as [ Also I can't think of a good reason why you'd want to explicitly cast an object into a subclass (the concept of type casing technically doesn't exist in python). (I don't quite know what context this came up in, but the first one that comes to mind is you're trying to get an overriden method |
comment:3
This casting is used all over the place. Immutability has nothing to do with it, a tuple is immutable and yet I can cast it as a list. One can cast a Partition as a Composition:
Which is the correct behavior? |
comment:4
You're not casting when you do that, you're creating a new object altogether, including tuples/lists:
In python, I believe the copy is done lazily, so if it's an immutable type, it is safe to just return the original object. Sage follows this paradigm. With your example above, Casting is something which tells the program that the same object is a different type. For example in C++ class Foo {
};
class Bar : public Foo {
public:
B() { }
};
Foo *f = new Bar();
Bar *b = (Bar) f; The last line is casting because a priori, the computer doesn't know |
comment:5
(if you want this ticket to be closed ...) Nathann |
Reviewer: Travis Scrimshaw |
Right now, if I have a standard tableau, I can't cast it as a tableau. For instance:
Component: combinatorics
Keywords: tableau
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/14260
The text was updated successfully, but these errors were encountered: