Changes between Version 3 and Version 5 of Ticket #15480


Ignore:
Timestamp:
12/03/13 23:48:44 (7 years ago)
Author:
andrew.mathas
Comment:

I was just looking at this and I agree it's a mess. I thought that you might be able to get away with just

        if self.cardinality()!=other.cardinality():
            return False
        if self.cardinality()==1:
            return True
        if self.alphabet() != other.alphabet():
            return False
        return type(self)==type(other)

but this does not catch

sage: Words("abcd") == WordPaths("abcd")
True

As I don't really play with these things it is not clear to me that these two should be equal.

Is this really correct?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15480

    • Property Commit changed from dbe5cbd894e2771f3f430ec310120af68b06022a to ad1cb6306d1dd48b2aa91c92ca00bf10fe1430b2
  • Ticket #15480 – Description

    v3 v5  
    1 Right now equality between sets of words only compare the alphabets
     1Right now equality between sets of words only compare the alphabets:
    22
    33{{{
     
    1414}}}
    1515
    16 I am not proud of this patch's code, but I see NO other way to all these wrongs answers without rewriting the class hierarchy. The fact that a class of finite words is an instance (i.e. it inherits) from a class of infinite words makes it really hard to implement `O_o`
     16I am not proud of this patch's code, but I see NO other way to fix all these incorrect answers without rewriting the class hierarchy. The fact that a class of finite words is an instance (i.e. it inherits) from a class of infinite words makes it really hard to implement `O_o`
    1717
    1818{{{
     
    2323You cannot be sure, when implementing the `__eq__` method of `Words_all`, that self really represents an infinite class of words.
    2424
    25 Besides, the old code read :
     25Besides, the old code reads:
    2626
    2727{{{