Ian Kelly <ian.g.ke...@gmail.com> writes:

> I suggest defining x as a normal function and writing the assignment
> as "Foo.x = staticmethod(x)" to keep x callable from the global
> namespace.  Or just del it after doing the monkey patch.

You can use Foo.x = staticmethod(lambda: 2)
-- 
Piet van Oostrum <p...@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to