2009/3/3 Jeffrey Yasskin <jyasskin at gmail.com>: > Unfortunately, I think overloading functions on Number or Iterable > would be really useful, and constraining it to only look at base > classes would be unfortunate. That could well be the case. So the question is, I guess, how would you write such a function now? Because you could always continue to write it like that, but make it generic for the other special cases you didn't think of: @simplegeneric def foo(x, y): if isinstance(x, Iterable): do iterable processing else: do standard base processing @foo.register(int) def foo_int(x, y): do int processing It's unfortunate that you have to cover it in the base processing, but certainly no worse than at present. Paul.
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