564 | | def extra_super_categories(self): |
565 | | """ |
566 | | EXAMPLES:: |
567 | | |
568 | | sage: Rings().hom_category().extra_super_categories() |
569 | | [Category of sets] |
570 | | """ |
571 | | from sage.categories.sets_cat import Sets |
572 | | return [Sets()] |
573 | | |
574 | | # def get_Parent(self, X, Y): |
575 | | # """ |
576 | | # Given two objects X and Y in this category, returns the parent |
577 | | # class to be used for the collection of the morphisms of this |
578 | | # category between X and Y. |
579 | | |
580 | | # Returns self.ParentMethods by default. |
581 | | |
582 | | # Rationale: some categories, like Rings or Schemes, currently |
583 | | # use different classes for their homset, depending on some |
584 | | # specific properties of X or Y which do not fit in the category |
585 | | # hierarchy. For example, if X is a quotient field, morphisms |
586 | | # can be defined by the image of the generators, even if Y |
587 | | # itself is not a quotient field. |
588 | | |
589 | | # Design question: should this really concern the parent for the |
590 | | # homset, or just the possible classes for the elements? |
591 | | # """ |
592 | | # category = self.base_category |
593 | | # assert(X in category and Y in category) |
594 | | # # return self.hom_category()(X, Y)? |
595 | | # #print self.hom_category(), X, Y, self.hom_category().parent_class, self.hom_category().parent_class.mro() |
596 | | # return self.ParentMethods |
597 | | |
598 | | class ParentMethods: |
599 | | # Design issue: when X is a quotient field, we can build |
600 | | # morphisms from X to Y by specifying the images of the |
601 | | # generators. This is not something about the category, |
602 | | # because Y need not be a quotient field. |
603 | | |
604 | | # Currently, and to minimize the changes, this is done by |
605 | | # delegating the job to RingHomset. This is not very robust: |
606 | | # for example, only one category can do this hack. |
607 | | |
608 | | # This should be cleaned up upon the next homset overhaul |
609 | | |
610 | | def __new__bx(cls, X, Y, category): |
611 | | """ |
612 | | """ |
613 | | from sage.rings.homset import RingHomset |
614 | | return RingHomset(X, Y, category = category) |
615 | | |
616 | | def __getnewargs__(self): |
617 | | """ |
618 | | Note: without this method, :meth:`.__new__` gets called with no |
619 | | argument upon unpickling. Maybe it would be preferable to |
620 | | have :meth:`.__new__` accept to be called without arguments. |
621 | | |
622 | | """ |
623 | | return (self.domain(), self.codomain(), self.category()) |
| 564 | pass |