[Guido] > ... > [*] For a while I toyed with the idea of calling the abstract base > class 'string', and hacking import so that sys.modules['string'] is > the string class. The abstract base class should then have methods > that invoke the concrete implementations, so that string.split(s) > would be the same as s.split(). > ... > Unfortunately this broke down when I realized that the signature of > string.join() is wrong for the string module: the string.join function > is string.join(sequence, stringobject) while the signature of the > string method is join(stringobject, sequence). > ... > (Hm, it could be saved by making string.join() accept the arguments > in either order. Gross. :-) Luckily, it's also hopeless: >>> string.join('abc', ' - ') 'a - b - c' >>> That is, since strings are also sequences, there's no way to disambiguate the pass-2-strings case. Although, if you ask me, it's obvious I wanted the result shown instead of ' abc-abc ' <wink>.
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