Armin> I recently discovered that os.path.commonprefix(list-of-strings) Armin> returns the longest substring that is an initial segment of all Armin> the given strings, and that this has nothing to do with the fact Armin> that the strings might be paths. :-) I discovered the same thing over a year ago, fixed the problem in CVS, then got roundly booed because I'd changed the semantics. I think it broke some bit of code of Mark Hammond's. I recently used this function to find the common prefix in a bunch of email addresses and prefaced it with this comment: # don't be fooled by "os.path." - commonprefix operates char-by-char! pfx = os.path.commonprefix(all_addrs) The Tools/scripts/trace.py file has a component-wise implementation of commonprefix(). Skip
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