On 6 Aug 2002 at 7:44, Guido van Rossum wrote: > > So whether '' in 'abc' will work or not is a red > > herring. The real issue is that membership gets > > conflated with subsetting. > > Well, in current Python you can only safely make > that transformation when you're damn sure that char > is a string of length one, otherwise you'd risk a > TypeError. So this code (if correct) will continue > to work, assuming you're not cathing TypeError > (which is often an assumption when we say that a new > feature "won't break old code"). I agree that x in str meaning "subset of" is more intuitive. I believe you are correct (at least most old code will still work), but this one makes me uneasy (I admit possibly because x in str has always made me uneasy). And finally, I vote that testing for subset should work in the mathematically correct way (when testing for the empty subset). This does not affect your argument. (In fact, Tim is arguing to have half[1] the code that catches TypeErrors continue to work, while the other half doesn't.) 'Nuff said. -- Gordon http://www.mcmillan-inc.com/ [1]No, probably not by lines of code.
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