> 2. a 'defop' syntax as shorthand for 'addmethod()', such that e.g.:
>
> import operator
>
> class Foo:
> defop iter(self):
> ...
> defop len(self):
> ...
> defop operator.getitem(self, key):
> ...
Is "defop" useful?
Why wouldn't it be possible to enable special method lookup with this kind
of syntax:
iter = generic_function()
iter.lookup_special_method("__iter__")
And then the classical:
class Foo:
def __iter__(self):
pass
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com