On 4/21/2015 6:41 PM, Chris Barker wrote: > Well, it'll catch passing in a string instead of a sequence of strings > -- one of teh common and semi-insidious type errors I see a lot (at > least with newbies). > > Oh wait, maybe it won't -- a string IS a sequence of strings. That's why > this is an insidioous bug in teh first place: > > List[string] > > will work, yes -- but now I'm locked down the user to an actual, list, > yes? So I try: > > Iterable[string] > > ah yes -- now users can use tuples of strings, or a custom class, or -- > but wait, darn it, a string IS an iterable of strings.. SIGH. I was just thinking today that for this, typing needs a subtraction (difference) operation in addition to an addition (union) operation: Difference(Iterable(str), str) -- Terry Jan Reedy
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