Hi Travis, On 2013-03-04, Travis Scrimshaw <tsc...@ucdavis.edu> wrote: > I most likely messed something up when I was doing this the first time > through...I had a pickling issue come up with number of arguments with the > classcalls vs. __init__, but I think I solved that differently...
Number of arguments (in particular: default arguments!) is indeed something that can be taken care of by a __classcall_private__ or a __classcall__ (depending on the situation). Note that one of my current projects is to automatically take care of default arguments, so that class Bla(UniqueRepresentation): def __init__(self, a=3): <do some init> would automaticalls yield sage: Bla() is Bla(3) is Bla(a=3) (currently, this would require adding a classcall_private) > I was worried something like Partitions(3) would not be the same as > Partitions(int(3)), No. The (weak) cache used in UniqueRepresentation uses a Python WeakValueDictionary. In particular, the keys are compared by equality. Hence, sage: 3.0==3==int(3)==long(3)==NN(3) True these different versions of 3 would give *identical* output. > Could you send me the patch with your > changes (since trac is currently down, we can't create the followup ticket)? I am confident the server will soon enough be up. If it isn't by tomorrow, I'll send you the patch. Cheers, Simon -- 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.