On Tuesday, 30 July 2013 14:18:28 UTC+2, Simon King wrote: > > Hi all, > > On 2013-07-29, Simon King <simon...@uni-jena.de <javascript:>> wrote: > > After all, we have a class, and we call the class as if to create an > > instance---but what we get is in fact not an instance of this class, but > > is instance of a *totally* different class. > > > > OK, it is possible, Python let's you do it. But not all what can be done > > should be done. > > > > I have nothing against the following pattern: > > > > ... > > > > And I think this pattern is totally fine, since C(...) returns instances > > of sub-classes of C (namely of A resp. B)---hence, it returns instance > > of C! I could imagine that a similar pattern would be available for > > Partition versus PartitionTuple. > > I determined all classes-with-ClasscallMetaclass that sometimes return > instances that are not instances of this class: > sage.combinat.composition.Compositions > > > sage.combinat.integer_vectors_mod_permgroup.IntegerVectorsModPermutationGroup > > sage.combinat.partition.Partitions > sage.combinat.partition_tuple.PartitionTuple > sage.combinat.posets.poset_examples.Posets > sage.combinat.root_system.type_relabel.CartanType > sage.combinat.tableau_tuple.StandardTableauTuple > sage.combinat.tableau_tuple.StandardTableauTuples > sage.combinat.tableau_tuple.TableauTuple > sage.combinat.tableau_tuple.TableauTuples > plus three classes that seem only to be made for doctests. > > 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)? > > I have no objection provided that the new code continues to respect the underlying *mathematical relationships* between these classes. I think that changing the classes so that they respect semantic niceities whilst breaking the underlying mathematical relationships, which these classes are meant to emulate, would be a mistake. It would also delay my porting into sage what I think is probably the best avilable code for working with representation theory of the symmetric groups in positive characteristic.
Andrew -- You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-combinat-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-combinat-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-combinat-devel. For more options, visit https://groups.google.com/groups/opt_out.