[Python-ideas] anonymous object support

Chris Rebert pyideas at rebertia.com
Mon Jul 25 03:01:18 CEST 2011


> 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

On Sun, Jul 24, 2011 at 5:14 PM, Devin Jeanpierre
<jeanpierreda at gmail.com> wrote:
> @apply
>> Or is that too evil?

Apparently so much so that Python 3 eliminated it.
Cheers,
Chris


More information about the Python-ideas mailing list

AltStyle によって変換されたページ (->オリジナル) /