On Fri, Sep 30, 2011 at 09:50:42PM -0700, Fletcher Johnson wrote:
> Is it possible to overload operators for a function?
>
> For instance I would like to do something roughly like...
>
> def func_maker():
> def func(): pass
>
> def __eq__(other):
> if other == "check": return True
>
On Fri, Sep 30, 2011 at 9:50 PM, Fletcher Johnson wrote:
> Is it possible to overload operators for a function?
>
> For instance I would like to do something roughly like...
>
> def func_maker():
> def func(): pass
>
> def __eq__(other):
> if other == "check": return True
> return False
>
Is it possible to overload operators for a function?
For instance I would like to do something roughly like...
def func_maker():
def func(): pass
def __eq__(other):
if other == "check": return True
return False
func.__eq__ = __eq__
return func
newfunc = func_maker()
newfunc ==