Issue #26576: Merge from 3.5

This commit is contained in:
Berker Peksag 2016-08-03 10:17:51 +03:00
commit 91494d3b73
1 changed files with 5 additions and 4 deletions

View File

@ -503,11 +503,13 @@ are applied in nested fashion. For example, the following code ::
@f2
def func(): pass
is equivalent to ::
is roughly equivalent to ::
def func(): pass
func = f1(arg)(f2(func))
except that the original function is not temporarily bound to the name ``func``.
.. index::
triple: default; parameter; value
single: argument; function definition
@ -638,14 +640,13 @@ Classes can also be decorated: just like when decorating functions, ::
@f2
class Foo: pass
is equivalent to ::
is roughly equivalent to ::
class Foo: pass
Foo = f1(arg)(f2(Foo))
The evaluation rules for the decorator expressions are the same as for function
decorators. The result must be a class object, which is then bound to the class
name.
decorators. The result is then bound to the class name.
**Programmer's note:** Variables defined in the class definition are class
attributes; they are shared by instances. Instance attributes can be set in a