Hi,

Just to let you know, sage -combinat install still failed to apply on sage-5.7

{{{
applying trac_12895-subcategory-methods-nt.patch
patching file sage/categories/category_singleton.pyx
Hunk #3 FAILED at 277
1 out of 3 hunks FAILED -- saving rejects to file
sage/categories/category_singleton.pyx.rej
patch failed, unable to continue (try -v)
patch failed, rejects left in working dir
errors during apply, please fix and refresh
trac_12895-subcategory-methods-nt.patch
Abort
}}}

Comparing the .rej (see below) with the patch, it seems that
everything related to sage/categories/category_singleton.pyx fails to
apply.

Best,
Vincent


--- category_singleton.pyx
+++ category_singleton.pyx
@@ -257,32 +278,41 @@ class Category_singleton(FastHashable_cl
             sage: MyRingsSingleton()
             Category of my rings singleton

-        Note that when calling :class:`Category_singleton` directly
-        then there is no cache used::
+        Instanciating :class:`Category_singleton` triggers an assertion error::

-            sage: Category_singleton() is Category_singleton()
-            False
+            sage: Category_singleton()
+            Traceback (most recent call last):
+            ...
+            AssertionError: <class
'sage.categories.category_singleton.Category_singleton'> is not a
direct subclass of <class
'sage.categories.category_singleton.Category_singleton'>

-        You must **never** subclass a subclass of :class:`Category_singleton`.
-        Otherwise, the instance the sub-sub-class may become identical with
-        the instance of the sub-class::
+        Instantiating a subclass of a subclass of :class:`Category_singleton`
+        also triggers an assertion error::

-            sage: class MyStuff(Category_singleton): pass
+            sage: class MyStuff(Category_singleton):
+            ...       def super_categories(self): return [Sets()]
+            sage: class MySubStuff(MyStuff): pass
+            sage: MySubStuff()
+            Traceback (most recent call last):
+            ...
+            AssertionError: <class '__main__.MySubStuff'> is not a
direct subclass of <class
'sage.categories.category_singleton.Category_singleton'>
+
+        even if ``MyStuff`` has already been instanciated::
+
             sage: MyStuff()
             Category of my stuff
-            sage: class MySubStuff(MyStuff): pass
             sage: MySubStuff()
-            Category of my stuff
+            Traceback (most recent call last):
+            ...
+            AssertionError: <class '__main__.MySubStuff'> is not a
direct subclass of <class
'sage.categories.category_singleton.Category_singleton'>
         """
         cdef FastHashable_class obj
-        if cls.__mro__[1] is not Category_singleton:
-            # Actually this type error is invisible. But it makes sure that
-            # the __classcall__ for Category_singleton is not overridden
-            # when someone is calling it.
-            raise TypeError, "%s is not a direct subclass of
%s"%(cls,Category_singleton)
-        obj = UniqueRepresentation.__classcall__(cls)
+        assert cls.__mro__[1] is Category_singleton, \
+            "%s is not a direct subclass of %s"%(cls,Category_singleton)
+        obj = super(Category_singleton, cls).__classcall__(cls)
         obj._hash = <Py_ssize_t><void *>cls
-        return ConstantFunction(obj)
+        cls._set_classcall(ConstantFunction(obj))
+        obj.__class__._set_classcall(ConstantFunction(obj))
+        return obj

 #    @lazy_class_attribute
 #    def __hash__(cls):

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to