"""
This file collects tests requiring Cython.
"""
from sage.categories.category_singleton cimport FastHashable_class
cdef class ClassWithLargeHash(FastHashable_class):
"""
This class tests against a bug with :class:`FastHashable_class`
(in an earlier version of the patch at Trac #11900) that occurred
on systems where ``sys.maxint`` does not fit into a C int.
TESTS::
sage: import sage.tests.cython
sage: C = sage.tests.cython.ClassWithLargeHash(); C
A successfully created object with a very large hash
sage: hash(C) == sys.maxint
True
"""
def __init__(self):
import sys
self._hash = sys.maxint
def __repr__(self):
return 'A successfully created object with a very large hash'