An oddity in list comparison and element assignment

Alex Martelli aleax at mac.com
Thu Jun 1 22:16:16 EDT 2006


Slawomir Nowaczyk <slawomir.nowaczyk.847 at student.lu.se> wrote:

> On Thu, 01 Jun 2006 13:40:34 -0700
> michael.f.ellis at gmail.com wrote:
> 
> #> Scott David Daniels wrote:
> #> > Would you say that envelope containing five $100 bills is equal to
> #> > an envelope containing five $100 bills with different serial numbers?
> 
> #> Yes (unless I was testing the assertion that the second envelope did
> #> not contain counterfeits of the first)
> 
> So, what if Bank of America later decided that bills with serial
> numbers containing "7" are no longer valid?

Then Wachowia would no doubt be happy to take my business away from
BoA;-).

I suspect you believe BoA is some kind of "official" body -- it isn't,
just like Deutschebank is not one in Germany (rather, Bundesbank is).

Just to share some tidbits (about which, as an Italian now living
between San Francisco and San Jose, I'm sort of proud of...!-)...:

Bank of America is a private bank, founded in San Francisco more than
100 years ago by an Italian-American guy (Amadeo Giannini, born in San
Jose, CA, but to Italian-born parents) as "Bank of Italy", then renamed
in 1930 in part because the Italian State bank "Banca d'Italia"
objected.  It rose to prominence right after the SF earthquake of 100
years ago, by opening and staffing a temporary branch to ensure
depositors could access their money when they most needed it, while most
other banks were staying closed.

 
> In other word, *if* you assume equality must be preserved by future
> modifications, than no two different (modifiable) objects can ever be
> really equal.

Yes, apart from the (slight and understandable!) mistake about BoA's
role, this is an excellent example.  Here, a global change (to the rule
about what banknotes are "equal" to each other, by making some of them
invalid and thus unequal to others) perturbs Michaels' desired "strong
equality definition" -- to preserve it, equality must degenerate to
identity.  A Python example would be a change to the default encoding
(not officially supported but achievable through a reload(sys), hint;-)
which could easily make a bytestring equal, or not, to a Unicode string!


Alex



More information about the Python-list mailing list