Le 30/07/2013 14:18, Simon King a écrit :
Hi all,
I determined all classes-with-ClasscallMetaclass that sometimes return
instances that are not instances of this class:
...
sage.combinat.integer_vectors_mod_permgroup.IntegerVectorsModPermutationGroup
...
What do you think? These are relatively few classes. Would it be
reasonable to change them, such that when on tries to create instances
of these classes then one is guaranteed to actually get an instance of
these classes (or a sub-class, at least)?
Hi Simon,
Concerning this class, I think it could be nice for the semantic to
change the code. It is probably something like a one or two lines
modification but the design deserves it.
Concerning Classcall in general, I am too young to have a strong
opinion. I just think that if no one is able to present a fair usecase
in which returning an instance of a total different class is really
useful, we should try to use the feature as you described. It is perhaps
no necessary to add an assert (I mean I can't judge that from my little
experience...) but for the semantic sake, the object returned should
definitely have the original class in the mro of its class... The proper
class or a derived class is clearly fine.
And thanks you so much for all your hard works on the design, the
coherence and the quality of Sage code in general, that allows level one
contributor like me to not crash on walls.
Cheers,
Nicolas B.
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.