Add an additional motivation for class decorators.
This commit is contained in:
parent
976c704677
commit
7ba16b49e0
10
pep-3129.txt
10
pep-3129.txt
|
@ -33,10 +33,12 @@ The motivating use-case was to make certain constructs more easily
|
||||||
expressed and less reliant on implementation details of the CPython
|
expressed and less reliant on implementation details of the CPython
|
||||||
interpreter. While it is possible to express class decorator-like
|
interpreter. While it is possible to express class decorator-like
|
||||||
functionality using metaclasses, the results are generally
|
functionality using metaclasses, the results are generally
|
||||||
unpleasant and the implementation highly fragile [#motivation]_. The
|
unpleasant and the implementation highly fragile [#motivation]_. In
|
||||||
fact that large-scale Python projects like Zope were going through
|
addition, metaclasses are inherited, whereas class decorators are not,
|
||||||
these wild contortions to achieve something like class decorators won
|
making metaclasses unsuitable for some, single class-specific uses of
|
||||||
over the BDFL.
|
class decorators. The fact that large-scale Python projects like Zope
|
||||||
|
were going through these wild contortions to achieve something like
|
||||||
|
class decorators won over the BDFL.
|
||||||
|
|
||||||
|
|
||||||
Semantics
|
Semantics
|
||||||
|
|
Loading…
Reference in New Issue