Hi!

At #11900, we have introduced a cdef class
sage.categories.category_singleton.FastHashable_class, which to my
knowledge has only been used to provide a fast hash to the class
CategorySingleton.

However, the default hash for instances of UniqueRepresentation
introduced in #14054 would be *faster* than the hash obtained from
FastHashable_class. Hence, FastHashable_class becomes superflous for
CategorySingleton.

It still has the benefit that it is quite fast, and that one can
prescribe the hash value. But I simply think it should not be in the
module sage.categories.category_singleton, and I would prefer to move
it into a new module sage.misc.fast_methods introduced by #14054.

I can't imagine that anyone is using FastHashable_class, except for
CategorySingleton. Nevertheless, Travis insists that we should keep
FastHashable_class available in sage.categories.category_singleton, with
a deprecation warning.

But how? Is there a standard way to deprecate an import location for a
class?

Ideally, the attempt to cimport (not import!) FastHashable_class would
result in a compile time warning, pointing to the new location. But at
least, I would like that
  from sage.categories.category_singleton import FastHashable_class
results in a deprecation warning, but does import a class (so that one
could inherit from it).

I would really like to see the deprecation warning when it is
*imported*, but not when its first instance is created (which might be
doable with some ClasscallMetaclass magic).

Is there a lazy_import with deprecation?

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


Reply via email to