#8120: UniqueRepresentation and hash value
------------------------------+---------------------------------------------
Reporter: hivert | Owner: hivert
Type: defect | Status: needs_work
Priority: major | Milestone:
Component: algebra | Keywords: UniqueRepresentation hash
Author: Florent Hivert | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------------+---------------------------------------------
Changes (by hivert):
* cc: zimmerma, nthiery (added)
Comment:
Hi Paul,
Replying to [comment:3 zimmerma]:
> I'd like to review that patch but I'm missing an example to try.
I'm not sure what you want: in the patch you have the following tests
example:
{{{
sage: class bla(UniqueRepresentation, SageObject): pass
sage: x = bla(); hx = hash(x)
sage: x.rename("toto")
sage: hx == hash(x)
True
}}}
If you want more elaborated examples using {{{UniqueRepresentation}}},
they are dozens of them through sage library (the ultimate goal is that
nearly each parent inherits from this). Pick you favorite one (prime.py is
a good example see #7397):
{{{
tomahawk-*ge-combinat/sage $ grep -l UniqueRepresentation **/*.py
categories/category.py
categories/enumerated_sets.py
categories/examples/commutative_additive_monoids.py
categories/examples/commutative_additive_semigroups.py
categories/examples/finite_coxeter_groups.py
categories/examples/finite_enumerated_sets.py
categories/examples/finite_monoids.py
categories/examples/finite_semigroups.py
categories/examples/finite_weyl_groups.py
categories/examples/infinite_enumerated_sets.py
categories/examples/monoids.py
categories/examples/semigroups.py
categories/examples/sets_cat.py
categories/primer.py
categories/semigroups.py
categories/sets_cat.py
combinat/crystals/affine.py
combinat/crystals/letters.py
combinat/free_module.py
combinat/root_system/cartan_type.py
combinat/root_system/root_system.py
combinat/root_system/type_dual.py
combinat/root_system/type_relabel.py
combinat/root_system/weyl_group.py
combinat/sf/sf.py
groups/matrix_gps/general_linear.py
groups/matrix_gps/special_linear.py
groups/perm_gps/permgroup_named.py
misc/classcall_metaclass.py
misc/constant_function.py
misc/nested_class_test.py
sets/disjoint_union_enumerated_sets.py
sets/finite_enumerated_set.py
sets/non_negative_integers.py
sets/primes.py
structure/all.py
structure/dynamic_class.py
structure/unique_representation.py
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8120#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.