Hi all,

On 2013-07-29, Simon King <simon.k...@uni-jena.de> 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)?

Best regards,
Simon


-- 
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.


Reply via email to