Message11069
Actually I'm warming to this.
The question of symmetry in == popped into my head later in the day too. In fact it works because str does not know what to do with your object and __eq__ is its own reverse. With obvious definitions, one can demonstrate it in pure Python (on Jython 2.7.0, of course).
>>> sys.platform = Multi('win32', 'java')
>>> sys.platform == 'java'
True
>>> 'java' == sys.platform
True
>>> sys.platform.startswith('win')
True
>>> sys.platform
Multi(set(['win32', 'java']))
>>>
Python: can't help but smile some days.
I guess this magical string should be unhashable, in case it ended up as a key in a dictionary? |
|
Date |
User |
Action |
Args |
2017-02-02 19:44:10 | jeff.allen | set | messageid: <1486064650.19.0.156057061926.issue2521@psf.upfronthosting.co.za> |
2017-02-02 19:44:10 | jeff.allen | set | recipients:
+ jeff.allen, zyasoft, stefan.richthofer, wymannmi |
2017-02-02 19:44:10 | jeff.allen | link | issue2521 messages |
2017-02-02 19:44:09 | jeff.allen | create | |
|