[Python-ideas] anonymous object support

Devin Jeanpierre jeanpierreda at gmail.com
Mon Jul 25 02:14:02 CEST 2011


@apply

Or is that too evil?

Devin

On Sun, Jul 24, 2011 at 7:48 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> You could use a class decorator to help with this.
>
> def instance(cls):
>    return cls()
>
> @instance
> class foo(object):
>  x = 42
>
> --
> Greg
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>



More information about the Python-ideas mailing list