[Andrew Koenig] > ... > Also, I think that in general, operations that should be used only > by people who really know what they're doing should be harder to > express. Yet another argument for removing floating point <0.898 wink>. While "is" serves a useful purpose in Python, I wouldn't mind if it were harder to spell. There have indeed been serious bugs due to misuse of "is", even in Python's standard library. The most notorious is that, until rev 1.15, asynchat.py used buf is '' in a conditional and got away with it for 3 years. This one is especially sucky because I'm sure the author knew better, but was obsessed with speed so talked himself into believing that CPython represents the empty string uniquely. It doesn't -- but it's not easy to find a counterexample! >>> a = "" >>> b = "" >>> a is b True >>> "abc"[:0] is "def"[:0] is a is "" is str(u"") is ""+"" is ""*0 True >>> import sys >>> sys.stdin.read(0) is a True >>> import array >>> buf = array.array('c', "") >>> buf.tostring() is a True >>> If you give up <wink>, see the checkin comment for asynchat.py rev 1.15.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4