[Python-ideas] New Python syntax for continuing definitions for existing classes

Ethan Furman ethan at stoneleaf.us
Tue Sep 13 13:21:28 EDT 2016


On 09/13/2016 09:29 AM, Chris Angelico wrote:
> On Wed, Sep 14, 2016 at 2:16 AM, Pim Schellart wrote:

A well-written PEP that looked very interesting.

> https://github.com/Rosuav/Decorators/blob/master/evil.py

> @monkeypatch
> class A:
>      x = 5
>      def foo(self):
>          pass
>      def bar(self):
>          pass

But this seems to solve the problem nicely.  In other words, you now need to explain why this particular class decorator is not good enough to solve the general problem.

--
~Ethan~


More information about the Python-ideas mailing list